Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
The system option SASSCRIPT= defines the location of the SAS/CONNECT script files. The value of the SASSCRIPT= SAS system option is a logical name or one or more aggregate storage locations (such as, directories or partitioned data sets). When you set the SASSCRIPT= system option, it generates another SAS system option, SASFRSCR, which is set to the value of a fileref that is used to build a list of scripts for SCL applications. When you establish a link while using SAS/ASSIST, this product uses the information provided by the SASFRSCR option to provide a list of available scripts. You can also build a similar menu of script files for user-written applications by accessing the SASFRSCR system option from an SCL program.
The following SCL program obtains the value of the SASFRSCR system option and uses it to create a list of scripts. Refer to SAS Component Language: Reference for information about the SCL functions used in this example.
INIT; return; MAIN: /* Get internally-assigned fileref. */ fileref=optgetc('sasfrscr'); /* Open the directory (aggregate storage */ /* location). */ dirid=dopen(fileref); /* Get the number of files. */ numfiles=dnum(dirid); /* Define a custom selection list the */ /* length of the number of files and */ /* allowing users to make one choice. */ call setrow(numfiles,1); return; TERM: /* Close the directory. */ rc=dclose(dirid); return; GETROW: /* Display the list of file names. */ filename=dread(dirid,_currow_); return; PUTROW: /* Get directory path name. */ fullname=pathname(fileref); /* Concatenate filename user selects */ /* with directory path name. */ name=fullname ||'/'|| filename; /* Other SCL statements to use complete */ /* filename stored in name. */ return;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.