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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grabbing Parm from Data Set when Submitting QMF via JCL

Status
Not open for further replies.

ks01

MIS
Aug 11, 2002
110
US
Hi everyone ...

I'm not sure if I'm posting my question in the correct forum, apologies if I'm not. My question is in regard to running a batch query via JCL on z/OS. Here are my job cards:

Code:
//XXXXXXXX JOB (0415,88500),'PROGRAMMER NAME',
//             CLASS=A,
//             MSGCLASS=J,
//             NOTIFY=&SYSUID,
//             REGION=0M
//OUT1     OUTPUT CLASS=J
//OUT2     OUTPUT CLASS=S
//*
/*JOBPARM SYSAFF=(MVSX)
//*
//*******************************************************************
//*  DELETE REPORT DATA SET FROM PREVIOUS RUN                       *
//*******************************************************************
//JOBLIB  DD DISP=SHR,DSN=DBP1.SDSNEXIT
//         DD DISP=SHR,DSN=DBP1.SDSNLOAD
//PROCS JCLLIB ORDER=(XXX.JCL.LIB)
//STEP00  EXEC PGM=IEFBR14
//DEL1      DD DSN=&SYSUID..XXXXXXX.REPORT,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(CYL,(0))
//*
//*******************************************************************
//*  RUN XXXXXXXX REPORT AND SEND TO USER'S DATA SET                *
//*******************************************************************
//STEP01  EXEC QMFBATCH
//DSQPRINT DD  DSN=&SYSUID..XXXXXXX.REPORT,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=RESDA,
//             SPACE=(TRK,(05,01),RLSE),
//             DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
//DSQDEBUG DD  SYSOUT=*,
//             DCB=(RECFM=FBA,LRECL=121,BLKSIZE=1210)
//SYSTSIN  DD  *
 EXECUTIL SEARCHDD(YES)
 ISPSTART PGM(DSQQMFE) NEWAPPL(DSQE) PARM(M=B,S=DBP1,P=QMF720, +
 I=XXXX.XXXXXXXX(&&EFFECTIVE_DT='2007-04-06')
//*
//*******************************************************************
//*  SEND REPORT TO CA-VIEW FOR ARCHIVING                           *
//*******************************************************************
//STEP02   EXEC PGM=IEBGENER
//SYSIN    DD  DUMMY
//SYSUT1   DD  DSN=&SYSUID..XXXXXXX.REPORT,
//             DISP=SHR
//SYSUT2   DD  SYSOUT=(,),OUTPUT=(*.OUT1,*.OUT2)
//SYSPRINT DD  SYSOUT=*
/*

What I want to do here is each time the user runs this job, I don't want them to go in and change the date in the JCL. I want the JCL to go look for the date value (a parm) in another data set. I want the user to go edit the date value in that parm data set to prevent the user from accidentally making any changes to the JCL and preventing it from running.

QMF is running the query from I=XXXX.XXXXXXXX and pulling the date from my condition EFFECTIVE_DT='2007-04-06'. I want to substitute this condition to pull from the external data set.

Does anyone have any experience with this?

Thanks in advance ...
 
KS01,

I would change the SYSTSIN DD statement to point to a dataset:
//SYSTSIN DD DSN=&SYSUID.XXXXXXXX.PARMIN, DISP=SHR

You could allow the user to edit this dataset direct, or you could write a REXX or CLIST that requests the date from the user, validates the date, and then edits the date into the dataset, thereby taking away the possibility of typos or user eror etc.

Hope this helps,

Marc
 
Hi Marc ...

Thank you very much for the response.

I will update the SYSTIN to reflect the changes you suggested. I have a question though, how do I tell QMF to get the parm it needs from the data set instead of using the (&&EFFECTIVE_DT='2007-04-06' variable I'm using now?

Also, I really liked your suggestion teh REXX/CLIST option validating the date to prevent user error. Unfortunately, I have no experience with REXX or CLIST. I would assume there would need to be a data set set up with a list of all the valid dates a user could enter and the logic set up in the REXX or CLIST exec would check the input of the parm data set with this data set? Do you know of where I may be able to go read up on this?

Thank you again ...
 
KS01,
I obviously did not make myself clear enough. The lines in the JCL:
Code:
//SYSTSIN  DD  *
 EXECUTIL SEARCHDD(YES)
 ISPSTART PGM(DSQQMFE) NEWAPPL(DSQE) PARM(M=B,S=DBP1,P=QMF720, +
 I=XXXX.XXXXXXXX(&&EFFECTIVE_DT='2007-04-06')
//*
should be replaced with the reference to the dataset mentioned previously. The specified dataset should contain the lines:
Code:
 EXECUTIL SEARCHDD(YES)
 ISPSTART PGM(DSQQMFE) NEWAPPL(DSQE) PARM(M=B,S=DBP1,P=QMF720, +
 I=XXXX.XXXXXXXX(&&EFFECTIVE_DT='2007-04-06')

Now you could let the user edit the dataset and change the date direct. If you were going to go down that path then I would suggest taking a copy of the dataset ready for when they make a mess of it.

Alternatively you may wish to go for the CLIST/REXX option. REXX/CLIST are programming languages that are fairly easy to use and learn, but I would suggest asking around at the site you are at to see which of these languages (if either) is used, and if there are any 'gurus' who can lend a hand. The task is certainly not a difficult one, but is one that I would imagine has been done before.

Let us know how you get on.

Marc
 
Hi Marc ...

When testing this job to run, we've run into another hiccup. We've been trying to modify the stored procedure in QMF to get this to run correct and have set it as follows:

Code:
 /* REXX */                                   
  ADDRESS ISPEXEC                             
"SET GLOBAL (A=('),EFFECTIVE_DT=&EFFECTIVE_DT"
"RUN QUERY QSTA123 (F FSTA123A"               
"PRINT REPORT (DA N"

However, when we run the job, there doesn't appear to be any output. I am assuming because the QMF command "PRINT REPORT (DA N" is not being recognized by REXX.

In the SYSPRINT step, it shows:

ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 0, OUT: 0

I've checked with my DBA and she is unfamiliar with REXX and our developers are unavailable to assist me right now.

Do you know what I could be doing wrong as to why I'm not getting any output?

Thanks ...
 
Hi KS01,

I'm a bit confused as I don't see where the REXX came into play. Why are you running a REXX exec in a QMF batch job?

Nevertheless, what you should be doing is testing each command that you are going to issue in QMF first, from within QMF in order to assure yourself that it does produce output. For instnace, does the effective date that you are trying to pass DEFINITELY produce results?

Once you have established that the query and QMF proc are correct, then you are left with the interface between batch jcl and QMF.

You should be able to see from the output exactly what is being passed to the batch QMF and what is being run. Is it the same as that which you expected?

Get back to me with an answer to the rexx/qmf question.

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top