![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
This example demonstrates the use of the SYSPARM system option in a UNIX environment.
Click on the Full Code tab for the program code.
Click on the Results tab to view the output.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
/*************************************************************/
/* To use this example, invoke a SAS session like this: */
/* */
/* sas -sysparm "01aug94 05aug91 10jan60" */
/* */
/*************************************************************/
/* Create a macro to parse the value passed to SYSPARM at */
/* invocation into three separate date values for use in the */
/* following DATA step. */
%macro split;
%let cnt=0;
%do %until(&temp eq);
%let cnt=%eval(&cnt+1);
%global parm&cnt;
%let temp=%scan(&sysparm,&cnt);
%let parm&cnt=%scan(&sysparm,&cnt);
/* Check the values of the new macro variables */
%put &&parm&cnt;
%end;
%mend split;
/* Execute the macro */
%split
/* Use the values passed to SYSPARM in a DATA step */
data b;
input mydate date7.;
if "&parm2"d <= mydate <= "&parm1"d;
datalines;
01jan89
01jan90
01jan91
01jan92
01jan93
01jan94
;
proc print;
format mydate date7.;
run;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Obs mydate 1 01JAN92 2 01JAN93 3 01JAN94
Type: | Sample |
Date Modified: | 2006-08-08 03:03:15 |
Date Created: | 2005-02-10 13:22:00 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | 64-bit Enabled Solaris | n/a | n/a |
64-bit Enabled HP-UX | n/a | n/a | ||
ABI+ for Intel Architecture | n/a | n/a | ||
AIX | n/a | n/a | ||
HP-UX | n/a | n/a | ||
HP-UX IPF | n/a | n/a | ||
Linux | n/a | n/a | ||
Solaris | n/a | n/a | ||
Tru64 UNIX | n/a | n/a | ||
64-bit Enabled AIX | n/a | n/a |