IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Execute an Mvs command with the COMMAND statement of JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Thu Jul 13, 2006 6:39 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top