The data used consists mainly of input parameters (`SYSPARM`) processed into macro variables, and date/time variables dynamically generated by SAS (`DATE()`, `DATETIME()`). There is no explicit reading of data from SASHELP tables or external sources in this code fragment, with the exception of what might be handled by the `create_report` macro, which is not provided.
1 Code Block
MACRO
Explanation : Defines the beginning of the `call_create_report` macro and initializes the `SYSPARM` macro variable with the value passed to SAS via the command line, then displays it in the log.
Explanation : This `DATA _NULL_` block is used to extract values from the `SYSPARM` macro variable. The `SCAN` function allows elements to be separated by commas, and `CALL SYMPUT` assigns them to new macro variables (`id_report_control` and `rundate`).
Copied!
data _null_ ;
call symput('id_report_control',trim(left(scan("&SYSPARM",1,',')))) ;
call symput('rundate',trim(left(scan("&SYSPARM",2,',')))) ;
run ;
Explanation : This block uses `%SYSFUNC` macro functions to manipulate and format dates and times. `rundate` is converted to SAS date format, `datestamp` obtains the system date in YYMMDD format, and `timestamp` extracts the time from the system timestamp in HH0000 format. A `zip_counter` variable is initialized to 0.
Copied!
/* rundate is the date variable of the extraction*/
%let rundate = %SYSFUNC(INPUTN(&rundate,yymmdd8.));
%put rundate=%sysfunc(putn(&rundate,yymmdd10.));
/*datestamp is the wariable for the ZIP file*/
%let datestamp = %sysfunc(DATE(),yymmdd6.);
%put datestamp=&datestamp.;
%let zip_counter = 0;
/*timestamp is the wariable for the ZIP file*/
%let timestamp = %sysfunc(substr(%sysfunc(DATETIME(),datetime19.),11,2))0000;
%put timestamp=×tamp.;
1
/* rundate is the date variable of the extraction*/
Explanation : Displays the final values of the `id_report_control` and `datestamp` macro variables in the log. Then, it calls the `create_report` macro (not defined in this code), passing all prepared macro variables as parameters. `ABSOLUTE` is a typo and is not valid. Finally, it ends the definition of the `call_create_report` macro.
Explanation : Sets global SAS options: `MPRINT` to display code lines generated by macros, `MVARSIZE=MAX` to allow large macro variables, and `NOQUOTELENMAX` to disable truncation of quoted strings. Finally, it executes the `call_create_report` macro.
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.
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.