LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Apr 2000 08:17:47 -0600
Reply-To:     jerry Durbin <Jerry_Durbin@BC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         jerry Durbin <Jerry_Durbin@BC.COM>
Subject:      Re: How to pass values from JCL to SAS program
Comments: To: SAS-L@LISTSERV.VT.EDU
Content-Type: text/plain

I've found a couple of ways depending upon need & how many parms/values you wish to pass. First, are these values SAS Options or values you want to use in the program? The method depends somewhat on the actual need case by case. Here are a couple of samples of use with regards to values being searched for in large files - I am sure there are many other and probably better ways...

Use of a single parm:

//* //* SCAN A FILE FOR USERID "KELLESW" //GETID SET SCANID=KELLESW

//SAS EXEC SAS,REGION=4M, // PARM='SYSPARM=''&SCANID''' //* //SYSIN DD * <CODE SNIPPED> LIDLEN = LENGTH(SYSPARM()); SRCHLID = SUBSTR(USRID,1,LIDLEN); IF SRCHLID = SYSPARM(); <CODE SNIPPED>

A bit more versatile: //* DOC: PULL INFORMATION FROM RAW SMF FILES

//* AND REPORT ON SPECIFIC DATASET(S) ACCESSES

//* The code allows for use of either DSNAME, JOBNAME, or //* USERID in the SYSPARM field and then the appropriate //* information being scanned for to be filled in after //PARMCARD //* //SAS EXEC SAS,REG=32M,SOUTRPT=C,

// PARM='MACRO SYSPARM=''DSNAME'''

//WORK DD UNIT=SYSDA,SPACE=(CYL,(500,150),RLSE)

//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(29,9),RLSE)

//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(29,9),RLSE)

//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(29,9),RLSE)

//SMFDATA DD DISP=SHR,DSN=OUR.SMF.FILE(-2)

//PARMCARD DD * DATASETS TO BE SCANNED FOR USES OF IN SMF

JD.JCLLIB.TOOLBOX

CICS.TMON20.BCISSYS.JCLPARMS

//*

//SYSIN DD *

/* GET THE REQUESTED SEARCH INFO */

DATA PARMDATA ;

INFILE PARMCARD MISSOVER;

INPUT @01 PVAR $44.

;

&sysparm = pvar ;

/* GET THE SMF DATASET & JOB RELATED RECORDS */ <LOTS OF CODE SNIPPED>

/* USE REQUESTED SEARCH & SAVE ONLY DESIRED SMF INFO */

PROC SORT DATA=PARMDATA nodups ;

BY &SYSPARM ;

PROC SORT DATA=SMF_RPTS nodups ;

BY &SYSPARM ;

DATA SMF_REC ;

SET PARMDATA(IN=A) SMF_RPTS(IN=B) ;

by &sysparm ;

retain Get_pvar pvar_len pvar ;

if a and pvar ne get_pvar then do ;

Get_pvar = pvar ;

pvar_len = length(pvar) ;

end ;

if pvar_len = 0 then goto done ;

if get_pvar = ' ' then delete ;

if pvar ne ' ' then delete ;

if substr(&sysparm,1,pvar_len) = get_pvar then output ; done: RUN ;

Hope this helps! JD

> -----Original Message----- > From: Baskaran Subramaniam [SMTP:subramaniam.baskaran@DB.COM] > Sent: Tuesday, April 25, 2000 7:40 AM > To: SAS-L@VM.MARIST.EDU > Subject: How to pass values from JCL to SAS program > > Hi Listusers > > We are an OS/390 and running batch SAS jobs, we have to pass some values > from the JCL to the SAS program. > > My query is > > 1. How do I pass the values from JCL ( Is it througn PARM parameter) > > 2. How do I receive the values in the SAS program. Is there any special > option involved? > > Tia > Baskar


Back to: Top of message | Previous page | Main SAS-L page