DATA Step, Macro, Functions and more

Need -sysparm more than 200 characters

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Need -sysparm more than 200 characters

Spoiler
 

Hello. I am running sas program on windows in batch. And I need to pass parameters to my .sas program. 

 

I have tried sysparm option, but it has limit in 200 char. 

Is there another way to solve my problem?

 

 

My sas version is 9.3


Accepted Solutions
Solution
‎07-06-2016 01:35 AM
Super User
Posts: 7,824

Re: Need -sysparm more than 200 characters

Posted in reply to ilya_1991

Store your parameters in a set of environment variables and retrieve them in the SAS program with %sysget.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎07-06-2016 01:35 AM
Super User
Posts: 7,824

Re: Need -sysparm more than 200 characters

Posted in reply to ilya_1991

Store your parameters in a set of environment variables and retrieve them in the SAS program with %sysget.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 9

Re: Need -sysparm more than 200 characters

Posted in reply to KurtBremser

I tried, but in the log I see the following message: wrong argument to function sysget

Super User
Posts: 3,256

Re: Need -sysparm more than 200 characters

Posted in reply to ilya_1991

Post your code. SYSGET works only in a DATA step or in a %SYSFUNC. %SYSGET is the macro version, for example:

 

data _null_;
  MyEnvVar = sysget('MyEnvVar');
run;

%let MyEnvVar = %sysget(MyEnvVar);
Contributor
Posts: 72

Re: Need -sysparm more than 200 characters

[ Edited ]
Posted in reply to ilya_1991

Ilya,

 

I like Kurt's response and bet that you do too.

 

If not, another way to do this is to store the parameters in a flat file.  The first thing your program could do would be to FILENAME the flat file and then read the flat file in a DATA _NULL_ step via an INFILE statement.  That step could eat the flat file and assign the parameters to macro variables that would be used further along in the program.

 

Could that work for you?

 

Best of luck in all your SAS endeavors!

----MMMMIIIIKKKKEEEE
(aka Michael A. Raithel)
Amazon Author's Page: http://www.amazon.com/Michael-A.-Raithel/e/B001K8GG90/ref=ntt_dp_epwbk_0
Occasional Contributor
Posts: 9

Re: Need -sysparm more than 200 characters

Posted in reply to MMMMIIIIKKKKEEEE

Thanks for reply. 
The problem was in the way I parsed parameters. 


MMMMIIIIKKKKEEEE, very interesting proposition, I'l try. 

Occasional Contributor
Posts: 9

Re: Need -sysparm more than 200 characters

Posted in reply to ilya_1991

Do we have some limitations on variable length in -set option?

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 351 views
  • 2 likes
  • 4 in conversation