The macro generates a SAS dataset whose content is derived from file system metadata (list of Unix/Linux files) rather than from a direct read of a pre-existing external dataset. The data is dynamically constructed within SAS from operating system information.
1 Code Block
MESSAGE LOG
Explanation : This block writes an informational message to the SAS log, indicating the call of the 'lsfp2ds' macro with its version. This is a common practice for debugging and execution tracking.
Copied!
%put MACRO CALLED: lsfp2ds v1.0;
1
%put MACRO CALLED: lsfp2ds v1.0;
2 Code Block
MACRO DEFINITION
Explanation : This block defines the `lsfp2ds` macro. It manages the output dataset name by assigning `_lsfp2ds` by default if the `dsout` parameter is not provided. The main task of listing files and creating the dataset is delegated to another macro, `%lsfp2sas`, which is called with the `filepattern` and the finalized `dsout` parameters.
%IF not %LENGTH(&dsout) %THEN %let dsout=_lsfp2ds;
3
%lsfp2sas(&filepattern,&dsout)
4
%mend lsfp2ds;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : This is public domain software. No guarantee as to suitability or accuracy is given or implied. User uses this code entirely at their own risk.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.