Page 1 of 1

REXX code to execute a JCL

Posted: Thu Apr 05, 2012 2:41 pm
by puneeth3377
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 *"

Posted: Thu Apr 05, 2012 3:40 pm
by dbzTHEdinosauer
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.

Posted: Thu Apr 12, 2012 9:26 am
by puneeth3377
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

Posted: Fri Apr 13, 2012 12:43 am
by DikDude
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.

Posted: Fri Apr 13, 2012 1:09 am
by dbzTHEdinosauer
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.

Posted: Fri Apr 13, 2012 6:52 am
by DikDude
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.

Posted: Sat Apr 14, 2012 4:06 pm
by NicC
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.

Posted: Wed Apr 18, 2012 10:21 am
by puneeth3377
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 ? :)

Posted: Wed Apr 18, 2012 12:26 pm
by NicC
Have you tried yet with a trace, as was suggetsed?