> Hi,
>
> I wanted to know if we could pass parameters to the
> SAS program which we use in %include statement using
> the sysparm option.
>
> If so.. Could you please tell me how do we do it?
>
> Thanks in advance.
-sysparm
is loaded as SAS starts
On win and unix platforms (but not on z/OS, iirc ) you can establish additional parameters in the invocation line
"path/sas.exe" -sysin your.prog.sas -set extra "additional_code.sas" -sysparm "what ever"
within your main program (named your.prog.sas above) you would add
%include !extra /source2 ;
then program "additional_code.sas" would be included.
Of course you could add it to the sysparm string, but then you will need to parse it out of that string if you use the sysparm for any other purpose.
When running on zOS you would need to provide the value in sysparm as sas is invoked. Your local methods for starting sas on z/OS may (normall) be different, so ask other sas programmers or an administrator.
Once SAS has started &sysparm is like any other macro variable, so expect to use %substr() or %scan() to extract the program name, into macro variable (for example) extra. Then just
%include "&extra" /source2 ;
If the additional program is the only thing in sysparm, then no scan or substr is needed, just
%include "&sysparm" /source2 ;
I'm recommending the /source2 option for the %include because it not only shows the lines of code included, but also shows the full external path and file name, which I find reassuring!
peterC