Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Help required in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Help required in REXX
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: 1770
Location: Bloomington, IL

PostPosted: Sun Dec 01, 2013 10:22 pm    Post subject:
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: 1825
Location: UK

PostPosted: Mon Dec 02, 2013 3:50 am    Post subject:
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: 52
Location: Chennai

PostPosted: Mon Dec 02, 2013 9:17 pm    Post subject:
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: 1825
Location: UK

PostPosted: Mon Dec 02, 2013 10:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us