DoDialogGetSaveDataSetFileName

Prototype

Matrix DoDialogGetSaveDataSetFileName( Matrix mPathName, String sTitle, String sInitialDir )

Return Value

The return value is 1 on success or 0 on failure. If the user clicks Cancel or closes the dialog box, the return value is 0.

Parameters

Matrix mPathName
Upon successful return, this matrix contains the fully qualified path and filename selected by the user.

String sTitle
The title of the dialog box.

String sInitialDir
The initial directory to be displayed by the dialog box. If sInitialDir is a null object, an empty string (""), or the string ".", the dialog box begins in the current directory.

Remarks

This module displays a dialog box that enables the user to specify the file in which a SAS data set should be stored. The module does not actually save the data set; it merely returns the filename specified by the user. The module calls the Windows function GetSaveFileName to display the dialog box.

If the user changes directories in the dialog box and sInitialDir is a null object or an empty string (""), IML Studio's current directory will be changed. If the user changes directories in the dialog box and sInitialDir is a non-empty string, the change will be local to the dialog box and IML Studio's current directory will not be changed.

Example
x = T(1:10);
declare DataObject dobj;
dobj = DataObject.Create( "Example", x );
run GetPersonalFilesDirectory( InitialDir );
InitialDir = InitialDir + "Data Sets";
title = "Save Data Set";
pathname = "Example.sas7bdat";
ok = DoDialogGetSaveDataSetFileName( pathname, title, InitialDir );
if ok = 0 then do;
    print "Function failed";
    quit;
    end;
dobj.WriteToFile( pathname );
See Also

DoDialogGetOpenDataSetFileName