Submitting JCL using REXX



IBM's Command List programming language & Restructured Extended Executor

Submitting JCL using REXX

Postby pub3377 » Thu Mar 14, 2013 12:35 pm

Hi Fellas,

I am total newbie to REXX. I just know how write a Hello World program.

Now I have been tasked with the following requirements.
1. Only replace the last line "ROUTINE SAVE*" to user based input
2. Submit this JCL.
3. Everything has to be done in REXX, the replacing of the string and the submit command.

Sample JCL is as below.

How do I do this??? :)

I am in desparate need. Please help.

//TSYSTLOS JOB (MYSYS,UV00),
// 'SYS/1243',
// NOTIFY=&SYSUID,
// CLASS=B,
// MSGLEVEL=(1,1),
// MSGCLASS=T
//*********************************************************************
//S010 EXEC PGM=PROGRAM,REGION=4M
//*********************************************************************
//STEPLIB DD DSN=MY.LOAD1,DISP=SHR
// DD DSN=MY.LOAD2,DISP=SHR
// DD DSN=MY.LOAD3,DISP=SHR
// DD DSN=MY.LOAD4,DISP=SHR
//SYSIDMS DD *
DMCL=DMCL000
DICTNAME=DXXXYY
DBNAME=DXXXZZ
//SYSOUT DD SYSOUT=*
//SYSLST DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SYSDUMP DD DUMMY
ROUTINE SAVE*
/*
pub3377
 
Posts: 5
Joined: Thu Mar 14, 2013 12:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting JCL using REXX

Postby prino » Thu Mar 14, 2013 1:24 pm

Ask your employer to send you on a course at a reputable training institute, rather than off-loading you to this forum!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 640
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Submitting JCL using REXX

Postby pub3377 » Thu Mar 14, 2013 2:55 pm

With all due respect Mr. Prino, that is not possible :)

Can anybody help me out with this?
pub3377
 
Posts: 5
Joined: Thu Mar 14, 2013 12:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting JCL using REXX

Postby Akatsukami » Thu Mar 14, 2013 3:00 pm

Depending on how much the JCL needs to be modified before each submission (job card? load library DSN?), a better course might be to create a skeleton and use ISPF file tailoring services, invoking them from Rexx. Read about file tailoring here.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Submitting JCL using REXX

Postby pub3377 » Thu Mar 14, 2013 3:04 pm

Hi Akatsukami,

Thank you for the link :)

There are no changes in any part of the job. I have to just change the last line "ROUTINE SAVE*" to any use given input.
pub3377
 
Posts: 5
Joined: Thu Mar 14, 2013 12:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting JCL using REXX

Postby Akatsukami » Thu Mar 14, 2013 3:54 pm

Well, I'd still use a skeleton.

Assuming for some reason that you can't, however, don't embed the JCL in the Rexx. Have it in a PS data set or PDS member somewhere; suck it into your script with EXECIO * DISKR to a stem (this is often not a good thing; however since your job is quite small, it's acceptable. If you write a script where you're not sure if your input data set has ten records or ten million in it, don't do this; in fact, use another language if possible). In a loop from 1 to stem.0, write to a temporary data set or PDS member. Test for the "ROUTINE SAVE*" (if that's definitely the only thing that'll be on that line, you can just use the equality operator; otherwise use the pos function and test for a non-zero return code). When you find it, read in the user input (and please don't tell me that you were planning to prompt for thousands of lines) and from write it instead. When you've written the last line, close the data set, free it, and submit it (using the SUBMIT command, of course).

If I have time, I'll write an example when I get in to my office.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Submitting JCL using REXX

Postby enrico-sorichetti » Thu Mar 14, 2013 4:05 pm

see here for a tested snippet on FTINCL facilities
http://ibmmainframes.com/about55549.htm ... ght=ftincl
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Submitting JCL using REXX

Postby pub3377 » Thu Mar 14, 2013 4:15 pm

Thanks for the suggestion :)

Now, they say the requirement. They want automate the process of searching throught IDD (CA IDMS) in the system :x
This will help in reducing the manual intervention needed during the analysis of the codes. I have no clue what they think.

I tried the following by googling. I am pretty certain there will be improvements in the following code :D

/* REXX */                                                             
/*TRACE I*/                                                             
SAY "ENTER A LETTER TO DISPLAY DATASETS "                               
PARSE UPPER PULL HLQ                                                   
                                                                       
SAY HLQ                                                                 
                                                                                                             
CALL UPDATE_DS                                                         
                                                                       
EXIT                                                                   

UPDATE_DS: PROCEDURE                                                   
PARSE ARG HLQ                                                           
                                                                       
SAY 'IN UPDATE_DS ' HLQ                                                 
                                                                       
ADDRESS TSO                                                             
"ALLOC DA(HLQ) F(UPDATEDD) OLD"                                         
                                                                       
EOF = 'NO'                /* INITIALIZE END-OF-FILE FLAG */             
DO FOREVER                                                             
   IF EOF = 'NO' THEN DO                                               
      "EXECIO 1 DISKRU UPDATEDD "                                       
      /* QUEUE THE NEXT LINE ON THE STACK */                           
                                                                       
      IF RC = 2 THEN                                                   
      /* RETURN CODE INDICATES END-OF-FILE */                           
         EOF = 'YES'                                                   
      ELSE                                                             
      DO                                                               
        PARSE PULL LINE                                                 
        SAY 'PLEASE MAKE CHANGES TO THE FOLLOWING LINE.'               
        SAY 'IF YOU HAVE NO CHANGES, PRESS ENTER.'                     
        SAY LINE                                                       
        PARSE PULL NEWLINE                                             
        IF NEWLINE = '' THEN NOP                                       
        ELSE                                                           
        DO                                                             
          PUSH NEWLINE                                                 
          "EXECIO 1 DISKW UPDATEDD"                                     
          I = I + 1                                                     
        END                                                             
      END                                                               
   END                                                                 
   ELSE                                                                 
       LEAVE                                                           
END                                                                     
"EXECIO 0 DISKW UPDATEDD (FINIS"                                       

RETURN
pub3377
 
Posts: 5
Joined: Thu Mar 14, 2013 12:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Submitting JCL using REXX

Postby enrico-sorichetti » Thu Mar 14, 2013 4:54 pm

why do You feel that somebody outside of Your organization shuld have more cues ??? :geek:

and about <Your> coding ... it is pure garbage ( no offense meant )
why not edit directly the dataset ???
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Submitting JCL using REXX

Postby Akatsukami » Thu Mar 14, 2013 10:43 pm

I won't go so far as to call this "garbage", but the days of the command line interface and prompting are long over. I seriously suggest, pub3377, that you put some time into a study of ISPF services and dialog development; you will find these things invaluable for tool development.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post