MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

passing parameters in JCL
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
yugee
Beginner


Joined: 17 Sep 2005
Posts: 25
Topics: 8

PostPosted: Sat Sep 17, 2005 10:39 pm    Post subject: passing parameters in JCL Reply with quote

Hi Experts,
I have the below requirement:
we have a cobol program which has to be executed indifferent LPARs. based on the LPAR certain parameters in the jcl will change.

currently, we are executing a step in the JCL to find in which LPAR this program is running. Based that we are setting the return code. In the next step we are passing the certain parameters based on the return code of the previous step.Suppose if the LPAR is 1T01, we are setting return code to 1, if LPAR is 1T02 then we are setting the return code to 2 and so on. there are totally 8 LPARs. so in worst case we are setting return code to 8. This is causingthe problems when the job completed. our CA7 is showing that, the job is abended due to the return code is greater than 6.
my question:
is there any other parameter available to use, instead of the return code.
please let me know if more details are required.
Thanks,
Yugee
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Sep 17, 2005 11:20 pm    Post subject: Reply with quote

Is there a reason you need to use more than 1 step? Can the program that determines the LPAR also just call the COBOL program? That should only require adding the DD statements from the 2nd step to the 1st step and modifying the program to do the call. If the program finding the LPAR is Rexx running within TSO (IKJEFT01) then it should be a trivial change to the Rexx program to optionaly do the allocaitons and call the COBOL program directly via the TSO CALL command. You didn't specify exactly how you are determining the LPAR name.
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 9:14 am    Post subject: Reply with quote

yugee,

I agree with semigeezer. Why do you need a seperate step to determine the lpar?

Actually you can determine lpar in the cobol program itself.

Check this link

http://mvsforums.com/helpboards/viewtopic.php?t=536&highlight=SMF-ID

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Sep 18, 2005 1:12 pm    Post subject: Reply with quote

It looks like the LPAR name comes out of the ECVT (CVT->CVTECVT->ECVTLPNM or try TSO ISRDDN B 10.?+8C?+158) where ECVTLPNM is blank if not in LPAR mode. My system real system this has a correct value, on my 2nd level system it is blank.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea2d240/26.1.1
Code:
/* Rexx to find current LPAR name */
cvt   = PTR(16)
ecvt  = PTR(cvt+140)
ecvtlpnm = storage(d2x(ecvt+344),8)
Say "LPAR name: '"|| ecvtlpnm|| "'"
Return 0
ptr: Return c2d(bitand(storage(d2x(arg(1)),4),'7fffffff'x))
Back to top
View user's profile Send private message Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Sun Sep 18, 2005 5:08 pm    Post subject: Reply with quote

semigeezer,

I tried TSO ISRDDN B 10.?+8C?+158) and on the first line I got the name of the test region. Is this information stored in any of the system variables ? like ZSYSID ? or ZSYSNODE ? Is this information available in option 7.3 from tso?

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Sun Sep 18, 2005 7:29 pm    Post subject: Reply with quote

yugee,
You can set the MAX RC for this job to 08 in CA7. It should not abend the job, however this is temporary workaround, not the right way to do things. thanks
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sun Sep 18, 2005 8:21 pm    Post subject: Reply with quote

Kolusu, to tell you the truth, I haven't kept up with what each of those varaiables actually contains. I'd guess that zsysnode is the node you' use on an XMIT command and that is probably maintained by JES. I'm not sure where ZSYSID comes from.
Dialog test variables are all visible in 7.3, but since some of the values from the various places to get a system name can be the same, that alone is not enough to determine the origin of the information. I suspect it is in the books too, but like I said, I just haven't checked lately.
Back to top
View user's profile Send private message Visit poster's website
yugee
Beginner


Joined: 17 Sep 2005
Posts: 25
Topics: 8

PostPosted: Sat Sep 24, 2005 5:04 pm    Post subject: Reply with quote

Hi Guys,
sorry for not providing the necessary information.
this is how my JOB looks like:
----------------------------JCL-----------------
Code:

//TEST1 JOB (NKTC),'FORMAT&PUTMQ',NOTIFY=&SYSUID,MSGCLASS=X
//   JCLLIB ORDER=(TEST.PROCLIB)                 
//JOBLIB DD DISP=SHR,DSN=TEST.LOADLIB             
//       DD DISP=SHR,DSN=TEST.DB2.DSNLOAD             
//*******STEP to get the LPAR information
//JS0100       EXEC PGM=IKJEFT01,       
//             DYNAMNBR=32,         
//             PARM='%PARM1'     
//SYSPROC   DD DISP=SHR,DSN=TEST.PARMLIB
//SYSTSIN   DD DUMMY               
//SYSTSPRT  DD SYSOUT=*             
//*******STEP to extetue the program in TA01 LPAR
// IF RC EQ 1 THEN
//S0200  EXEC PGM=PUTMQMSG
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD1.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD1.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD1.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF
//*******STEP to extetue the program in TA02 LPAR
// IF RC EQ 2 THEN
//S0200  EXEC PGM=KTCMSGFM
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD2.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD2.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD2.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF
//*******STEP to extetue the program in TA03 LPAR
// IF RC EQ 3 THEN
//S0200  EXEC PGM=KTCMSGFM
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD3.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD3.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD3.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF
**--------like this we have 8 STEPs--------**
// IF RC > 8 THEN                     
//REFABND4 EXEC PGM=ABNDPRGM
//SYSPRINT DD  SYSOUT=*     
//SYSUDUMP DD  SYSOUT=I     
// ENDIF                   
 
This is the PARM card to get the LPAR details:
 
TEST.PARMLIB(PARM1):
--------------------
    SETTING  = MSG('OFF')                 
                                           
    SYSNAME  = MVSVAR(SYSNAME)             
                                           
    SYSID    = SUBSTR(SYSNAME,1,4)         
    SELECT                                 
         WHEN(SYSID='TA01') THEN RCODE='1'
         WHEN(SYSID='TA02') THEN RCODE='2'
         WHEN(SYSID='TA03') THEN RCODE='3'
    END                                   
                                           
    RETURN(RCODE)                         
                                           
 EXIT
----------------------

If you see the JCL, there are certain parameters, i mean LOADLIBs change from one LPAR to another LPAR. suppose if the program is running in 'TA08' then the RETURNCODE will be 8 which is causing the problem.

please suggest me some good approach to handle this situation.

Thanks a lot,
yugee
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Sun Sep 25, 2005 8:42 am    Post subject: Reply with quote

yugee,

You can submit the job from the rexx itself to the intrdr which will create the approriate JCL based on the SYSID.

Check this link which shows the submission of a job from rexx

http://www.mvsforums.com/helpboards/viewtopic.php?t=42&highlight=intrdr

So your code will be

Code:

   SETTING  = MSG('OFF')                 
                                           
    SYSNAME  = MVSVAR(SYSNAME)             
    SYSID    = SUBSTR(SYSNAME,1,4)         
    SELECT                                 
         WHEN(SYSID='TA01') THEN
         queue "//JOBNAME1  JOB (ACCT) MSGCLASS=X,MSGLEVEL=(1,1),CLASS=B"
         queue "//STEP01    EXEC PGM=IEFBR14"
         queue "ZZ"
         'SUBMIT * END(ZZ)'

         WHEN(SYSID='TA02') THEN
         ... queue the job for different lpar
         WHEN(SYSID='TA03') THEN
         ... queue the job for different lpar
    END                                   
 EXIT


Hope this helps...
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yugee
Beginner


Joined: 17 Sep 2005
Posts: 25
Topics: 8

PostPosted: Sun Sep 25, 2005 12:36 pm    Post subject: Reply with quote

Hi Kolusu,
Thanks for ur suggestion. I think it will solve my problem almost..but in this case i need to have 8 different JCLs. is there any way i can handle this in a single JCL itself..
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Sep 26, 2005 4:35 am    Post subject: Reply with quote

Quote:

but in this case i need to have 8 different JCLs. is there any way i can handle this in a single JCL itself..


yugee,

Why do you need 8 JCL's? At any time you will only be running one step, so use a single jobcard which will have different step based on the sysid.

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yugee
Beginner


Joined: 17 Sep 2005
Posts: 25
Topics: 8

PostPosted: Tue Sep 27, 2005 9:43 pm    Post subject: Reply with quote

As per the standards, i can not have all my job statements in the REXX code. and also as part of the change contraol we are having one more step to execute another program in the same job. what i am looking for is, is there any parameter i can pass from REXX code instead of RCODE based on the LPAR. What ever the information u guys have provided is definitely going to help me.thanks a lot for ur suggestions..
Yugee
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Sep 28, 2005 12:22 am    Post subject: Reply with quote

I don't understand why you want to do this at all since all of the constraints are very artificial (1 job stream for multiple LPARs, invocation through a separate non-TSO JCL step for every program, max RC of 7, etc...) Certainly submitting 8 separate jobs, or having a job step that submits the appropriate job through the TSO SUBMIT command (IKJEFT01) would be easier than trying to fit all this processing into these artificial conditions. But to answer your question, to control the flow of steps in JCL, all you have is the condition code. There are times when using JCL is the correct way to do things. This, apparently, is not one of those times.

So here is the 2nd worse suggestion I've ever made on one of these boards (the worst involved using TSO TEST to dynamically write and execute machine level code like SVCs directly from Rexx). Although technically feasible, rest assured, it is not a serious suggestion!!

If you have to check for more than 8 values using condition codes that can not exceed 7, you can probably use separate steps and treat the return codes as octal. That is a 1st step returns the 1st digit of an octal number and the 2nd step returns the 2nd digit. Then you use COND or IF/THEN logic in the JCL to check the output of 2 steps instead of 1. Then you have up to 64 conditions. Use 3 steps (digits) and you have up to 512 possible conditions.

Yes, this is a ridiculous way to do things, and anyone who put that into production should be fired immediately, but it is theoretically possible. Smile Rolling Eyes

Oh. And that #1 worst suggestion I mentioned? See 'ISP.SISPCLIB(ISRSVC2X)'. It calls SVCs 26 and 27 from a CLIST. This code was written by a professional lunatic. Don't try this at home Smile
Back to top
View user's profile Send private message Visit poster's website
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Wed Sep 28, 2005 2:05 am    Post subject: Reply with quote

trying to guess who's the lunatic...

Code:

/* Instructions:                                                    */ 
/*          This must be run from the TSO TEST ready prompt         */ 
/*             Eg:  ISRSVC2X NADEL.CLIST PRM903 LOCATE              */ 
/*                  ISRSVC2X NADEL.CLIST PRM903 OBTAIN              */ 
/*                                                                  */ 

Shocked
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Sep 28, 2005 7:40 am    Post subject: Reply with quote

Yugee,

How about using a SET statement ? You can set a number depending on the lpar , instead of a return code. Once you set the value, then you can just INCLUDE it in the JCL.

Create a PDS member named SETLPAR

Now your REXX will create the member SETLPAR

Code:

    SETTING  = MSG('OFF')                 
    SYSNAME  = MVSVAR(SYSNAME)             
    SYSID    = SUBSTR(SYSNAME,1,4)         
    SELECT                                 
         WHEN(SYSID='TA01') THEN
         write to pds member set lpar with the following info
         '//  SET LPAR=1  '
         WHEN(SYSID='TA02') THEN
        write to pds member set lpar with the following info
         '//  SET LPAR=2  '
         WHEN(SYSID='TA03') THEN RCODE='3'
        write to pds member set lpar with the following info
         '//  SET LPAR=3  '
        ...
    END                                   


Now you will have another Job which will have the set statement included.
Code:

//TEST1 JOB (NKTC),'FORMAT&PUTMQ',NOTIFY=&SYSUID,MSGCLASS=X
//   JCLLIB ORDER=(TEST.PROCLIB)                 
//JOBLIB DD DISP=SHR,DSN=TEST.LOADLIB             
//       DD DISP=SHR,DSN=TEST.DB2.DSNLOAD             

//        INCLUDE MEMBER=SETLPAR   <==== INCLUDE THE LPAR NUMBER
 
//*******STEP to extetue the program in TA01 LPAR
// IF &LPAR EQ 1 THEN   
//S0200  EXEC PGM=PUTMQMSG
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD1.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD1.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD1.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF
//*******STEP to extetue the program in TA02 LPAR
// IF &LPAR EQ 2 THEN
//S0200  EXEC PGM=KTCMSGFM
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD2.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD2.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD2.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF
//*******STEP to extetue the program in TA03 LPAR
// IF &LPAR EQ 3 THEN
//S0200  EXEC PGM=KTCMSGFM
//STEPLIB DD DISP=SHR,DSN=SYSA.MQLOD3.USERAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD3.SCSQAUTH       
//        DD DISP=SHR,DSN=SYSA.MQLOD3.USERLOAD       
//INFILE  DD DISP=SHR,DSN=TEST.INPUT.FILE
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
// ENDIF

**--------like this we have 8 STEPs--------**
// IF &LPAR EQ 8 THEN 
//REFABND4 EXEC PGM=ABNDPRGM
//SYSPRINT DD  SYSOUT=*     
//SYSUDUMP DD  SYSOUT=I     
// ENDIF                                                           


The IF clause is then expanded during the run time which will result as

Code:

// IF 1 EQ 1 THEN


By doing so you don't have worry about the return codes.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group