REXX code to execute a JCL

Ask/Clarify the questions on TSO, CLIST & REXX

Moderators: Veera, Moderator Group

Post Reply
puneeth3377
Member
Posts: 3
Joined: Thu Apr 05, 2012 2:28 pm
Location: Bengaluru

REXX code to execute a JCL

Post by puneeth3377 » Thu Apr 05, 2012 2:41 pm

Hi All,

I am very new to REXX coding, and i need your help in running a JCL :)

The requirement is to accept input from user, store it in stem variable, pass each value to a search loop, where i have used queuing mechanism to run the JCL. I found the queuing mechanism by googling :)

I have done the following REXX code, but it giving major problems.
Please help me out.

/*REXX*/
SAY "HELLO" USERID()
SAY "ENTER THE CHARACTER TO BE SEARCHED IN IDD"
SAY "ENTER 'X' TO INDICATE END OF LIST"

I = 0 /*INDEX FOR SEARCH STEM*/
STAR_STRING = '*'

DO UNTIL SEARCH_STRING='X'
PULL SEARCH_STRING
IF SEARCH_STRING='X'
THEN
DO
SAY "END OF INPUT BY USER"
SAY "BYE" USERID()
END
ELSE
DO
I = I + 1
SEARCH_STRING.I = SPACE(SUBSTR(SEARCH_STRING,1,20) STAR_STRING,0)
SAY "SEARCHING FOR" SEARCH_STRING.I
CALL SEARCHING
END
END
EXIT


SEARCHING: PROCEDURE
SAY ARG(1)
QUEUE'//SEARCH JOB (U212,UV00),'
QUEUE"// 'UID',"
QUEUE'// NOTIFY=&SYSUID,'
QUEUE'// CLASS=J,'
QUEUE'// MSGLEVEL=(1,1),'
QUEUE'// MSGCLASS=T'
QUEUE'//*--------------------------------------------------------------'
QUEUE'//S010 EXEC PGM=PROG,REGION=4M'
QUEUE'//*--------------------------------------------------------------'
QUEUE'//SYSOUT DD SYSOUT=*'
QUEUE'//SYSLST DD SYSOUT=*'
QUEUE'//SYSABOUT DD SYSOUT=*'
QUEUE'//SYSDUMP DD DUMMY'
QUEUE'//SYSIN DD *'
QUEUE'ARG(1)'
QUEUE'/*'
QUEUE'//'
"SUBMIT *"
Puneeth

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Apr 05, 2012 3:40 pm

learn to use TRACE with your REXX scripts (found in manual, links at top of page)

what error are you encountering?

look at EXPOSE in the manual, it may help you.
in your procedure you are looking for an argument,
but your CALL syntax did not provide an argument.

do not say it does not work, provide the exact error codes that you encountered.
and learn to use TRACE.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

puneeth3377
Member
Posts: 3
Joined: Thu Apr 05, 2012 2:28 pm
Location: Bengaluru

Post by puneeth3377 » Thu Apr 12, 2012 9:26 am

Hi Dick,

I am not facing any errors while running the jcl. When I tso exec the rexx code, the displays are shown and job is submitted. But, the I am facing problem in the following.
QUEUE'//SYSIN DD *'
QUEUE'ARG(1)'
QUEUE'/*'

When i go into the spool and use 'SJ' it shows,
//SYSIN DD*.

That's the only thing i got :(

Frankly speaking, I started working mainframes since 2010. My first job. Since then I have done only testing. This is my first hands-on as a programmer. Any help to solve the above issue is greatly appreciated :D
Puneeth

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Apr 13, 2012 12:43 am

It may help if you post the actual jcl and sysin data that is submitted rather than a bit of code that shows only part of the job.
Have a good one

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Apr 13, 2012 1:09 am

if your spool display facility shows the contents of instream datasets, after the fact,
good for you,
if not, you are not going to see it detailed in the spool sysout.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Apr 13, 2012 6:52 am

Try submitting the same job manually rather than thru rexx. Is the sysin data visable in sdsf?

You've not yet posted the actual job as requested earlier.
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sat Apr 14, 2012 4:06 pm

I just did an SJ against a job in SDSF (before execution) and it displayed the 'input data' of SYSIN DD * so I guess it should be there. Probably needs to run with trace enabled.
Regards
Nic

puneeth3377
Member
Posts: 3
Joined: Thu Apr 05, 2012 2:28 pm
Location: Bengaluru

Post by puneeth3377 » Wed Apr 18, 2012 10:21 am

Hi All,

Thank you for the responses! :)

I was out of town for a few days.

Here is the actual JCL.

//SEARCH JOB (U212,UV00),
// UID,
// NOTIFY=&SYSUID,
// CLASS=J,
// MSGLEVEL=(1,1),
// MSGCLASS=T
//*--------------------------------------------------------------
//S010 EXEC PGM=PROG,REGION=4M
//*--------------------------------------------------------------
//STEPLIB DD DSN=MY.LOAD,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSLST DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SYSDUMP DD DUMMY
//SYSIN DD *
EMPLOYEE
/*

Could any of you here help in converting this to a REXX code, like the one I have tried ? :)
Puneeth

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Wed Apr 18, 2012 12:26 pm

Have you tried yet with a trace, as was suggetsed?
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others