BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'd like to find out how to execute an MVS program and pass a Parm to it using SAS PROC.

The JCL looks like this:
//step exec pgm=program,parm='parameter'

I'd like to be able to insert the program into a sas program.

proc program parm='parameter';
run;

This does not work. The program does execute, but the parm is ignored.

Thanks,
Chuck Kirschke
7 REPLIES 7
Cynthia_sas
SAS Super FREQ
Hi:
Actually, I think it was PARMCARDS or SYSPARM or something like that for your JCL. And then that only SENT the parms to the Global Symbol Table...when your program started, if you only sent one value via the SYSPARM, you were OK just using &SYSPARM. But if you sent more than one value on your jobcard, then you had to split up the SYSPARM or PARMCARD into pieces.

But, my memory must not be quite right. I see in the documentation that SYSPARM is for UNIX and that PARMCARDS seems to be for z/OS. I do not have the documentation for MVS, so I don't actually know which one worked for MVS, or how it worked.

You could try this:
[pre]

//STEP1 EXEC SAS,OPTIONS='SYSPARM=wombat'
//SYSIN DD *

** write parameter value to LOG;
%put the parameter is: &SYSPARM;

** use parameter value in title;
proc print data=sashelp.class;
title "SYSPARM= &SYSPARM";
run;
/*
[/pre]

I got the above syntax from this 2005 paper:
http://www.lexjansen.com/pharmasug/2002/proceed/coders/cc05.pdf
BUT, there's a different syntax here:
http://www.caliberdt.com/tips/Jul2005.htm and I don't have an MVS system to test on.

Your best bet for help would be to contact Tech Support for specific assistance with MVS and JCL and how to go about passing parameters to SAS.

cynthia
deleted_user
Not applicable
The issue is not how to pass parms to a SAS program.

I'm looking for advice on passing a parameter while in a SAS program to another program that is being called using the PROC statement.

Thanks,
Chuck
Cynthia_sas
SAS Super FREQ
Hi:
Wow, I did not get that at all from your original question! I don't understand what you mean by "passing a parameter while in a SAS program to another program that is being called using the PROC statement"? As I remember from my JCL days, a JCL procedure of 3 steps could be something like this:
[pre]
//MYJOB JOB (111,222),'my sas job',CLASS=2,MSGCLASS=Q,NOTIFY=XXX123
//STEP1 EXEC SAS
//DATAIN DD DSN=XXXXXX.YYYYYY.FLATFILE.SEQ,DISP=SHR
//SASLIB DD DSN=XXXXXX.YYYYYY.SASLIB.ACCT,DISP=OLD
//SYSIN DD *

data saslib.new;
infile DATAIN;
input @1 charvar $8. @10 numvar comma8.;
run;

proc freq data=saslib.new;
tables charvar;
run;
/*
//* ***** ***** ***** ***** ***** *****
//STEP2 EXEC IEBGENER
// ... more JCL and IEBGENER statements
//* ***** ***** ***** ***** ***** *****
//STEP3 EXEC SAS
//SASLIB DD DSN=XXXXXX.YYYYYY.SASLIB.ACCT,DISP=SHR
//SYSIN DD *

proc means data=saslib.new;
var numvar;
run;
/*
//

[/pre]

Do you mean passing a parameter from SAS in STEP1 to SAS in STEP3??? Or creating something inside Step 1's DATA step program that would be used in Step 1's PROC FREQ???? I still think the best thing for you to do is to contact Tech Support for help on this.

cynthia
deleted_user
Not applicable
Hi,

Its possible to call a program as a SAS PROC.

For example:

proc idcams;
run;

This will run IDCAMS just as if it were in JCL like:
//js010 exec pgm=idcams

Of course you would have to define the DD statements and the data that would be in the //SYSIN file.

This works.


I have another program. Currently it is executed like this:

//js010 exec pgm=,parm=''
//in dd *

//out dd dsn=,etc. . . .

I have successfully executed it as:

proc ;
run;

But I can't pass the parameter to it.

I've tried:
proc ; parm='';
run;

proc ;
parmcards;

run;

data _null_;
call ('');
run;

and several other variations.


I just want to pass a parameter to a program that is executed using the SAS PROC statement.

Thanks,
Chuck Message was edited by: chuckkirschke
Cynthia_sas
SAS Super FREQ
Hi:
That's pretty cool. The only thing I could find were these 2 Tech Support documents:
http://support.sas.com/techsup/technote/ts738.html
http://support.sas.com/techsup/technote/ts575.html

The first one (738) says that the feature is not officially supported. But it does have an example of passing a parm like this:
[pre]
OPTIONS PARM=’NEW’;
PROC IEBUPDTE;
RUN;

[/pre]

The second document (575) is an example of a COBOL module being called. Even though it's not officially supported, it seems that Tech Support would be the ones to help with this if you're still having issues.

cynthia
deleted_user
Not applicable
Using "options parm='';" worked.

Thanks for your help.
deleted_user
Not applicable
It certainly is possible, and the most reliable solution I found created a PDS member in job step 1.

Then in Job step 2 you refer to this PDS member as a SYSIN which means you can put as much from the SAS step into the other step as you wish.

It is also possible to do this using TEMP library assignments, but I don't have anything running the best OS in the world here to test the syntax.

Kind regards

David

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 7 replies
  • 2090 views
  • 0 likes
  • 2 in conversation