View previous topic :: View next topic
|
Author |
Message |
rajendra kalepu
New User
Joined: 29 Jul 2011 Posts: 21 Location: India
|
|
|
|
Hi Team,
I am having a requirement to pass the files dynamically and submit a JCL
My JCL residing in 'MYID.TEST.JCL(MYJOB)'
//JOBCARD --------------------> HAVING A JOB CARD
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=&INPUT1,DISP=SHR
//SORTOUT DD DSN=&OUTPUT1,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// UNIT=DISK,
// DCB=*.SORTIN
//SYSOUT DD SYSOUT=*
//SYSIN DD *
//SORT FIELDS=COPY
/*
REXX Used to invoke the above JCL
/*REXX*/
ADDRESS ISPEXEC
"LIBDEF ISPLIB DATASET ID('MYID.TEST.JCL')"
"LIBDEF ISPFILE DATASET ID('MYID.TEST.JCL')"
SAY 'PLEASE ENTER THE INPUT:"
PULL INPUT1 --> (INPUT FILE DSN USED IN MY JCL)
SAY 'PLEASE ENTER THE OUTPUT:"
PULL OUTPUT1 --> (OUTPUT FILE DSN USED IN MY JCL)
ADDRESS ISPEXEC
"FTOPEN"
"FTINCL MYJOB" --> MEMBER NAME
"FTCLOSE"
SAY RC
ADDRESS TSO
X=OUTTRAP('ABC.')
"SUBMIT 'MYID.TEST.JCL(MYJOB)'"
Y=OUTTRAP('OFF')
SAY ABC.1
RETURN 0
When i am executing the above rexx, My job is submitting fine but the files which i am giving were not getting substituted and i am getting JCL error as 'DATA SET NOT FOUND'
Please help me if i was coding some where wrong
Thank you
Rajendra |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
If you have not re-typed (and thereby loaded with typos) this skeleton and exec, then they had slightly less chance of working than I have of being elected king of the world. To choose only one such error, note the use of different quotes at the beginning and end of your prompts.
Please copy-and-paste, not re-type, your code and enclose it in Code tags for a non-zero chance of receiving meaningful help. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You are submitting your skeleton - not the temp file created by file tailoring. |
|
Back to top |
|
|
Ramsee
New User
Joined: 06 Jan 2011 Posts: 53 Location: Chennai
|
|
|
|
Hi Rajendra,
Warm greetings!
I would suggest you to use the below check for a your requirement.
1.To verify whether the DSN is present or not, If not present you can throw an exception that DSN not found.
Code: |
STATUS1 = SYSDSN("'"INPUT1"'")
ADDRESS TSO
IF STATUS1 <> 'OK' THEN
DO
SAY "INPUT DSN IS NOT FOUND"
CALL EXIT_PROCESS
END
STATUS2 = SYSDSN("'"OUTPUT1"'")
IF STATUS2 = 'OK' THEN
DO
SAY "OUTPUT DSN IS ALREADY EXISTS"
CALL EXIT_PROCESS
END
|
2. Please follow the flow to SUBMIT your JOB
Code: |
"FTINCL MYJOB"
"FTCLOSE"
"VGET ZTEMPF"
ADDRESS TSO "SUBMIT '"ZTEMPF"'"
RETURN
|
I guess now your JOB will be submitted without any errors.
Kindly let us know still you face any issues for further understanding and help. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Ramsee
You cannot "throw" an error because "throw" is not valid mainframe terminology. "Terminate with an error", "display an error message", etc is the correct terminology.
You can you use "throw" with reference to "curly-wurly" languages such as C and Java but otherwise "throw "means have something in your hand and eject it at pace. |
|
Back to top |
|
|
|