DoDialogGetOpenDataSetFileName

Prototype

Matrix DoDialogGetOpenDataSetFileName( 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 a SAS data set file they wish to open. The module does not actually open the data set file; it merely returns the filename specified by the user. The module calls the Windows function GetOpenFileName 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
run GetInstallationDirectory( InitialDir );
InitialDir = InitialDir + "Data Sets";
title = "Open Data Set";
ok = DoDialogGetOpenDataSetFileName( pathname, title, InitialDir );
if ok = 0 then do;
    print "Function failed";
    quit;
    end;
declare DataObject dobj;
dobj = DataObject.CreateFromFile( pathname );
DataTable.Create( dobj );
See Also

DoDialogGetSaveDataSetFileName