BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cosmid
Lapis Lazuli | Level 10

options nobomfile; *byte-order mark;

%let progDir=%scan(&sysparm.,1,'|');

%let program=%scan(&sysparm.,4,'|');

%let dataYear=%scan(&sysparm.,5,'|');

 

Hi, above is the first few lines of a SAS code. I know it's scanning for words by position separated by |, 1st, 4th, and 5th words were assigned to the variables.

 

I can' understand the definition: SYSPARM enables you to pass a character string from the operating environment to SAS program steps and provides a means of accessing or using the string while a program is executing.

 

Since the default value for sysparm is null then where does the value for &sysparm come from? Is another program ran before or maybe in parallel with this program and sysparm gets the value from there?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The value would come from the command string that initiates SAS.

For example the destop Icon I use to start SAS has the TARGET property of

"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"

That is the command string.

If I wanted to add a sysparm option available every time I clicked on that icon would add something like

-sysparm= "list of words"

This could be handy if I wanted to have different Icons on the desktop and pass different values.

 

Also if a batch program is used to start SAS, possibly from a scheduling program as one example, then you could add the -sysparm option to the command line. Your batch program generator might pass different options. In the scheduler example I might want something different passed at "morning" program than for an "evening" program start.

View solution in original post

3 REPLIES 3
ballardw
Super User

The value would come from the command string that initiates SAS.

For example the destop Icon I use to start SAS has the TARGET property of

"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"

That is the command string.

If I wanted to add a sysparm option available every time I clicked on that icon would add something like

-sysparm= "list of words"

This could be handy if I wanted to have different Icons on the desktop and pass different values.

 

Also if a batch program is used to start SAS, possibly from a scheduling program as one example, then you could add the -sysparm option to the command line. Your batch program generator might pass different options. In the scheduler example I might want something different passed at "morning" program than for an "evening" program start.

cosmid
Lapis Lazuli | Level 10

Yes! A batch from a scheduling program. Thank you! I have now find where the -sysparm and the values for it in other two files. I'm still not sure how the sysparm works but hopefully with more experience and learning I might be able to write code using it one day.

 

Thanks again!

ballardw
Super User

The SYSPARM is on of those options that is very operationally dependent. I have used SAS off and on for over 30 years and never needed it. I did test it once but my organizations have never had a need for such.  -SYSIN has been another matter though. Smiley Wink

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 706 views
  • 2 likes
  • 2 in conversation