saveas
saveas
PATH

The saveas statement saves a copy of the currently active file under a new name. The original file remains unchanged.

Parameters

This statement has one parameter:

path – is a path to the file to be saved, including the file name (see Files and Folders for more information about file paths). If you want to save the new file in the same folder as the existing file, this parameter can simply be the new file name. The path doesn’t have to have a file extension, but if it does, the extension must be `.pandb` (if omitted, the extension will be automatically added for you).

Description

This statement performs the same action as the Save As command in the File menu. A copy of the current database is assigned a new name, then saved. (Note: The original database is not saved, so it will not have the most recent changes.).

This example assumes that the current database has a name like Sales 2018–04. The procedure will save the database on the disk. If this is a new month it will save the database under a new name for the new month (for example Sales 2018–05), leaving the old month on the disk.

    local fileroot,filesuffix
    fileroot=firstword(info("databasename"))
    filesuffix=lastword(info("databasename"))
    if filesuffixe=datepattern(today(),"YYYY-MM")
        save
    else
        saveas fileroot+" "+datepattern(today(),"YYYY-MM")
    endif

See Also

- Database Integrity Checks -- checking database integrity when opening and saving.
- print -- prints the database.
- printonerecord -- prints the the currently active record.
- revert -- reloads the last saved version of the database from the disk.
- save -- saves the database to disk.
- saveacopyas -- saves a copy of the currently active file under a new name. The original database remains open in memory under its original name.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now allows the path to be either UNIX or HFS format. Also, the dialog option is no longer supported.