![]() Chapter Contents |
![]() Previous |
![]() Next |
| FILENAME, CATALOG Access Method |
| Valid: | anywhere |
| Category: | Data Access |
Syntax |
| FILENAME fileref CATALOG 'catalog' <catalog-options>; |
| Arguments |
| Catalog Options |
Catalog-options can be any of the following:
| Default: | For input, the actual LRECL value of the file is the default. For output, the default is 132. |
| Range: | V (variable), F (fixed), and P (print). |
| Default: | V |
| Default: | If you omit MOD, the file is replaced. |
| Details |
The CATALOG access method in the FILENAME statement enables you to reference a SAS catalog as an external file. You can then use any SAS commands, statements, or procedures that can access external files to access a SAS catalog. As an example, the catalog access method makes it possible for you to invoke an autocall macro directly from a SAS catalog. See Executing an Autocall Macro from a SAS Catalog.
| Examples |
This example submits the source program that is contained in SASUSER.PROFILE.SASINP.SOURCE:
filename fileref1
catalog 'sasuser.profile.sasinp.source';
%include fileref1;
filename dir catalog 'mylib.include'; %include dir(mem1); %include dir(mem2); %include dir(mem3);
filename mydata
catalog 'sasuser.data.update.catams';
/* write data to catalog entry update.catams */
data _null_;
file mydata;
do i=1 to 10;
put i;
end;
run;
/* read data from catalog entry update.catams */
data _null_;
infile mydata;
input;
put _INFILE_;
run;
This example writes code to a catalog SOURCE entry and then submits it for processing:
filename incit
catalog 'sasuser.profile.sasinp.source';
data _null_;
file incit;
put 'proc options; run;';
run;
%include incit;
libname mysas 'SAS-data-library'; filename mymacros catalog 'mysas.mycat'; options sasautos=mymacros mautosource; %reports
| See Also |
Statements:
|
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.