Rexx pgm to pass JCl statements



IBM's Command List programming language & Restructured Extended Executor

Rexx pgm to pass JCl statements

Postby jaggz » Mon Oct 25, 2010 2:03 pm

Hi folks,
Iam new to Rexx Programming and i need to execute a Rexx program that contains JCL statements inside to it. Im also in need to pass value to a certain parameters in that JCL through REXX. So that it looks like a menu driven pgm.
User avatar
jaggz
 
Posts: 356
Joined: Fri Jul 23, 2010 8:51 pm
Has thanked: 8 times
Been thanked: 4 times

Re: Rexx pgm to pass JCl statements

 

Re: Rexx pgm to pass JCl statements

Postby NicC » Mon Oct 25, 2010 5:32 pm

I do not understand - I THINK I understand SOME of your requirement but not all.

You need to write or execute a rexx program? Or both?

Rexx programs cannot contain JCL statements - the rexx interpreter would not know what to do with them. You can have strings within your rexx program that represent JCL statements and these can be assigned to variables.

I am not sure what you mean about the rest. My best guess is, if this is related to your other post today re ALIAS, that you want to get a parameter or 2 into the rexx program, create JCL for an IDCAMS job that contains these parameters in the IDCAMS control cards and submit that job. If this is correct then to prompt for the parameters use the SAY command, to get the parameters from the user use the PULL command, create the job from constant strings intermixed with the variables holding your PULLed parameters, write the generated JCL to a file and then issue the TSO SUBMIT command.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Rexx pgm to pass JCl statements

Postby NicC » Sun Oct 31, 2010 9:00 pm

So, have you resolved this yet? Or do you need more assistance?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Rexx pgm to pass JCl statements

Postby Pedro » Tue Nov 02, 2010 6:53 pm

If you need a menu, you will need to create an ISPF panel.

You can use the QUEUE instruction of rexx to build your JCL. This example will compress a PDS:
/* REXX */                                                   
parse arg indsn                                               
indsn = strip(translate(indsn,"","'"))                       
say indsn                                                     
queue  "//PEDROC    JOB ,                                  " 
queue  "//         MSGLEVEL=(1,1),MSGCLASS=H,USER=&SYSUID, " 
queue  "//         NOTIFY=&SYSUID,TIME=2,REGION=24M        " 
queue  "//STEP1   EXEC PGM=IEBCOPY                         " 
queue  "//SYSPRINT DD SYSOUT=*                             " 
queue  "//INDD1   DD DISP=SHR,DSN="||indsn                   
queue  "//OUTDD1  DD DISP=SHR,DSN="||indsn                   
queue  "//SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(10,20))         " 
queue  "//SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(10,20))         " 
queue  "//SYSIN DD *                                       " 
queue  "       COPY INDD=INDD1,OUTDD=OUTDD1                " 
queue  "/*                                                 " 
queue  "@#"                                                   
Address TSO "SUB * END(@#)"                                   


QUEUE is one way, but many people instead use ISPF file tailoring services to build the job.
Pedro Vera
User avatar
Pedro
 
Posts: 569
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 39 times

Re: Rexx pgm to pass JCl statements

Postby Viswanathchandru » Tue Nov 09, 2010 6:31 pm

Hi pedro,
Thanks for your post.!!!!
I tried with the way u posted. my requirment is to create a user id. The JCL is getting submitted but am getting error. can you pls help me on this. My jcl goes this way....

/* REXX */
SAY " HELLO "
SAY " JCL INSIDE A REXX "
QUEUE "//ALIASACE JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=B,"
QUEUE "// REGION=5M,NOTIFY=&SYSUID"
QUEUE "//STEP1 EXEC PGM=IDCAMS"
QUEUE "//SYSPRINT DD SYSOUT=*"
QUEUE "//SYSIN DD *"
QUEUE "//DEFINE ALIAS(NAME(TEST010) RELATE(CATALOG.NGF.VZ39CAT))"
QUEUE "/*"
QUEUE "22"
ADDRESS TSO "SUB * END(22)"


Thanks,
Viswa
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Rexx pgm to pass JCl statements

Postby Robert Sample » Tue Nov 09, 2010 6:43 pm

Problem 1. User ids are created by the security package (RACF or ACF2 or Top Secret), not by an IDCAMS job. You are creating an ALIAS which is a catalog entry, not a user id. Terminology is critical in IT, where similar terms may mean very different things. If you think you're creating a user id using this JCL, you need to go back to your security manuals and read them cover to cover.

Problem 2. After your //SYSIN DD * statement, the IDCAMS control statements cannot have // in columns one and two -- yours do.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Rexx pgm to pass JCl statements

Postby expat » Tue Nov 09, 2010 8:48 pm

Also, I would recommend the use of ISPF file tailoring rather than creating instream jobs via a REXX.

One place where I worked had about 19 different REXX codes that generated the self same JCL.
A real pain to maintain, but so much easier to update ONE ISPF skeleton tham 19 different REXX codes
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post