IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Help required in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajendra kalepu

New User


Joined: 29 Jul 2011
Posts: 21
Location: India

PostPosted: Sun Dec 01, 2013 6:52 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sun Dec 01, 2013 10:22 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Dec 02, 2013 3:50 am
Reply with quote

You are submitting your skeleton - not the temp file created by file tailoring.
Back to top
View user's profile Send private message
Ramsee

New User


Joined: 06 Jan 2011
Posts: 53
Location: Chennai

PostPosted: Mon Dec 02, 2013 9:17 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Dec 02, 2013 10:29 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top