Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Execute an Mvs command with the COMMAND statement of JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
peddy76

New User


Joined: 13 Jul 2006
Posts: 1

PostPosted: Thu Jul 13, 2006 4:54 pm    Post subject: Execute an Mvs command with the COMMAND statement of JCL
Reply with quote

Hi,

i need to execute an Mvs command with the COMMAND statement of JCL.
The problem is that i need to pass a variable in the DSN.

COMMAND 'S SLGWRT.WRT1,NOME=SYS3090.A15J.SYSLOG.&OGGI'
COMMAND 'ROUTE SYSRITA2, S SLGWRT.WRT2,NOME=SYS3090.SYSRITA2.SYSLOG.&IERI'

&OGGI and &IERI are two variables, but the command statement run without make the correct substitution.

How can i resolve the problem?

Sorry for my poor english... icon_razz.gif
Back to top
View user's profile Send private message

jasorn

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Thu Jul 13, 2006 6:39 pm    Post subject: Re: COMMAND Statement
Reply with quote

I don't run COMMANDS via jcl but I know you can, IEKJ* is think will do it. But I don't have access to a mainframe now. So I'm assuming that's what you're trying to do. The only method I've seen used to solve this type of problem is to use a program in an earlier step to replace the variable with it's value and use that program's output as the control card.

I've seen two methods used to solve this problem.

1. Use a different control card for each scenario. I hate this solution but see it quite often in production environments.

2. Use something like REXX or CLIST to make the substitution. This is a better solution in my opinion. But the implementations I've seen using this method haven't been general enough and for some reason the shops I've worked in usually have some extra restrictions on REXX and CLIST that tended to make them less desirable as a solution for some projects.

3. To solve this problem, many moons ago I created a simple COBOL program to make the substitution. Haven't had one problem using this method. It takes the name of the 'control card/deck', and a parameter that consistes of the string replacement information as input and puts out the new control card as output which is then used in the step that needs it. This process does have the drawback of needing an extra step in your jcl but that's not too bad.

The good thing about this method is people who don't know much about the mainframe can use it.

If there is interest, I can provide the COBOL source I use for this or answer any questions.

Here is what the jcl might look like:

Code:

//**********************************************************
//* THIS STEP READS IN A CONTROL CARD TEMPLATE THAT HAS TEXT //* THAT NEEDS TO BE REPLACED WITH VALUES OF SYMBOLIC
//* PARAMETERS.  THE OUTPUT IS THE CONTROL CARD WITH VALUES
//* REPLACED.
//*
//* IN THE PARM BELOW:
//*
//*    , = THE DELIMITER USED IN THE PARM ITSELF.  IN THIS CASE ','
//*         WILL BE USED TO SEPARATE ITEMS IN THE PARM. 
//*
//*    STRING1 = A STRING IN THE CONTROL CARD THAT YOU WANT TO
//*                     REPLACE
//*
//*    VAR1 = IS THE SYMBOLIC PARAMATER YOU WANT TO USE TO
//*                REPLACE STRING1.   IT'S INCLOSED IN '&' AND '.' SO THE
//*                VALUE OF THE SYMBOLIC PARAMETER IS USED.
//*                WITHOUT THOSE, 'VAR1' WOULD BE USED.
//*
//*    STRING2 = ANOTHER STRING IN THE CONTROL CARD THAT YOU
//*                     WANT TO REPLACE
//*
//*    VAR1 = IS THE SYMBOLIC PARAMATER YOU WANT TO USE TO
//*                REPLACE STRING1.  IT'S INCLOSED IN '&' AND '.' SO THE
//*                VALUE OF THE SYMBOLIC PARAMETER IS USED.
//*                WITHOUT THOSE, 'VAR1' WOULD BE USED.
//**********************************************************************
//JAS02A   EXEC PGM=JAS02,REGION=6M,
//       PARM=(',STRING1,&VAR1.,STRING2,&VAR2.')
//STEPLIB  DD DISP=SHR,
//              DSN=WHATEVER.MAKES.SENSE.FOR.YOUR.SHOP
//              DD DISP=SHR,DSN=CEE.SCEERUN
//SYSOUT  DD SYSOUT=*
//IN01       DD DISP=SHR,DSN=INPUT.CONTROL.CARD
//OUT01    DD DISP=(NEW,PASS,DELETE),
//         DSN=&&JAS02AO,
//         SPACE=(80,(100),RLSE),LRECL=80,RECFM=FB
//**********************************************************************
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri Jul 14, 2006 5:02 pm    Post subject:
Reply with quote

Hi,
You can try this.

Code:
 //stepname EXEC PGM=IKJEFT01,DYNAMNBR=nn,PARM='command'
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us