Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read a value from a JCL Stream 1

Status
Not open for further replies.

oucheeeeee

Technical User
Jul 8, 2008
9
Hi Folks,

Wrote the following code to check the contents of a one line dataset and dependent on what it finds, sets a RC=


"EXECIO" 1 "DISKR INPUTDD"
000011 pull line
000012 parse var line drop 115 extract 126
000013 say extract
000014 Select
000015 when extract = 'PTLF_EXTRAC' then rc = 03
000016 when extract = 'TLF_EXTRACT' then rc = 01
000017 otherwise
000018 say 'QRYMSG contains invalid command - check cols 115 - 125'
000019 say 'of UGT1.B24.ES64S.QRYMSG'
000020 RC = 99
000021 end
000022 exit rc


I have a new quest - instead of checking a dataset, how could I check something in a JCL stream. Can I substitute DISKIO for something that'll read JCL?

In the JCL, a value will be either XXXXXX or some other VALID entry. If it IS XXXXXX I want to set RC01 if anything else, RC03

Any pointers welcome.

Regards,

Rob
 
Er.... after seeing previous post.....

Full code example NOT required thx, just point and shoot

;-)
 
When you say "in the JCL" I suspect you actually mean "in the SYSOUT".

When your original JCL gets handed to the system, it gets processed by something called "the converter/interpreter" which renders it fit to produce results: symbolics get translated and stuff you left off (like volume serial numbers) get added. If you want the output of the C/I that's hard to get, especially while the job is still running.

If that's what you're after, REXX is probably the wrong language; you're in Assembler territory.

If not, re-ask the question with a little more detail.


Frank Clarke
--America's source for adverse opinions since 1943.
 
Hi Rexhead, thanks for taking a look.

It'd be nice if I could check sysout as I think I could pretty much use my same REXX that reads a line from the INPUTDD.

No, this one is simply a JCL stream that runs for numerous processes. ONE of these processes is a prefix file (which has an altidx). Therefore, if the statement LLQ=XXXXXXXX is changed to lets say LLQ=PRECOL, then we want to run the proc SIEMPTY. If LLQ=XXXXXXXX, then bypass the proc.

Maybe, as you say, REXX may not be the best way. I just looked at my previous routine (took me about 2 days to code - that's my level).

so......here's the JCL

//EC4CLR JOB (),CLASS=B,MSGLEVEL=(1,1)
//REBUILD EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=ECS4.PSYS.ES64.IDCAMS(#),DISP=SHR
//*
//SIEMPTY PROC LLQ=
//SIEMPTY EXEC PGM=SIEMPTY,REGION=0M
//STEPLIB DD DSN=ECS4.PLDD.ES64.IBAT.LOADLIB,DISP=SHR
// DD DSN=CEE.SCEERUN,DISP=SHR
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=ECS4.RLS.PAPP.ES64.&LLQ,DISP=OLD
// PEND
//*
//IPMDS EXEC SIEMPTY,LLQ=XXXXXX <=====
//*
//*//CANCEL EXEC PGM=NOTIFIER,COND=(8,LT),PARM=(#,
// EXCI,CANCELER)
//STEPLIB DD DSN=CICSTS23.CICS.SDFHEXCI,DISP=SHR
// DD DSN=ECS4.PLDD.ES64.SIS.LOADLIB,DISP=SHR
// DD DSN=ECS4.PLDD.ES64.LOADLIB,DISP=SHR
//EC4DES JOB (),CLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//


If the statement //IPMDS EXEC SIEMPTY,LLQ=XXXXXXX
contains any value other than XXXXXX, then run this step, if value is XXXXXXX then just end.


I can see my routine working if I could write that value to a dataset, I could use the same sort of thing. As the input is via JCL - is there a rexx utility that I can use?

Hope that helps.

Thanks again -

Rob

 
Here is a rexx soultion

/* REXX */
ARG parm
If parm = 'XXXXXXX' then exit 4
exit 0

//RXUSR001 JOB (REXXJCL),'TEST',
// CLASS=S,MSGCLASS=X,MSGLEVEL=(1,1),REGION=0M,
// NOTIFY=&SYSUID
/*
//SIEMPTY PROC LLQ=
//TSTEMTY EXEC PGM=IKJEFT1B,REGION=0M,DYNAMNBR=50,
// PARM='%SETRC &LLQ'
//SYSEXEC DD DISP=SHR,DSN=RXUSR.REXX.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SIEMPTY EXEC PGM=IEFBR14,COND=(0,NE,TSTEMTY)
// PEND
//TEST EXEC SIEMPTY,LLQ='XXXXXXX'
//

 
Butbutbutbut.... the JCL needs to specify the value of 'parm':
Code:
address TSO
"NEWSTACK"
queue "//RXUSR001 JOB (REXXJCL),'TEST',"
queue "//             CLASS=S,MSGCLASS=X,MSGLEVEL=(1,1),REGION=0M,"
...
queue "//         PEND "
queue "//TEST     EXEC SIEMPTY,LLQ="parm
/* maybe allocate a temp ds here */
/* "EXECIO" queued() "DISKW ..." */
sub *   /* ...or SUBMIT the temp ds */
"DELSTACK"
The "sub *" here is a guess. I've heard of others doing this but don't know for sure if it's possible. If it doesn't work, you can allocate a temporary dataset, write the JCL into it with EXECIO (as shown), and then SUBMIT the dataset.


Frank Clarke
--America's source for adverse opinions since 1943.
 
oucheeeeee stated that:

If the statement //IPMDS EXEC SIEMPTY,LLQ=XXXXXXX
contains any value other than XXXXXX, then run this step, if value is XXXXXXX then just end.

I believe that adding the TSTEMTY step to the proc and testing for a non-zero condition code in the subsequent steps of the proc, will accomplish this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top