Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
In JCL Procedure how we can execute REXX program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Dhananjayulu Neeli

New User


Joined: 15 May 2020
Posts: 2
Location: India

PostPosted: Sat May 16, 2020 12:01 am    Post subject: In JCL Procedure how we can execute REXX program
Reply with quote

Hi Team,

I have a Job in mainframe which is getting failed because empty file generating in previous step. So I have written REXX code to validate output file of previous step, if the output file is empty it will insert 1 record with space so that next step won't get fail. But in this job all the coding have done through procedure.

Can you help me with how can we run the developed REXX program between 2 steps with an example
Back to top
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1211
Location: Vilnius, Lithuania

PostPosted: Sat May 16, 2020 12:53 am    Post subject: Re: In JCL Procedure how we can execute REXX program
Reply with quote

Dhananjayulu Neeli wrote:
Hi Team,

I have a Job in mainframe which is getting failed because empty file generating in previous step. So I have written REXX code to validate output file of previous step, if the output file is empty it will insert 1 record with space so that next step won't get fail. But in this job all the coding have done through procedure.

Can you help me with how can we run the developed REXX program between 2 steps with an example

This is a forum for experts, for beginners posting in the Beginners forum is best.

(edited by moderator)
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2200
Location: Silicon Valley

PostPosted: Sat May 16, 2020 2:08 am    Post subject: Reply to: In JCL Procedure how we can execute REXX program
Reply with quote

Quote:
Can you help me with how can we run the developed REXX program between 2 steps with an example

If the job has two steps, you need to edit the JCL and manually add a new step after the existing first step.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Sat May 16, 2020 2:11 am    Post subject: Reply to: In JCL Procedure how we can execute REXX program
Reply with quote

Quote:
I have a Job in mainframe which is getting failed because empty file generating in previous step.


Your organisation is about 40 years late in good programming practices
a well behaved program should run even with empty datasets as input.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 373
Location: Denmark

PostPosted: Sat May 16, 2020 2:35 pm    Post subject:
Reply with quote

If I understand you right, then the answer is that you cannot insert a step into a procedure using overrides, you will need to rewrite the procedure.
If however you are asking about how to run REXX in batch then this is a sample of how:
Code:
//S1       EXEC PGM=IKJEFT1B,PARM=rexxname       
//SYSTSPRT DD SYSOUT=*                           
//SYSTSIN  DD DUMMY                             
//SYSEXEC  DD DISP=SHR,DSN=your.rexx.dataset.name
//ddname1  DD DISP=SHR,DSN=your.dataset.name     

where
your.rexx.dataset.name is the pds where you keep your REXX pgms
your.dataset.name is the dataset you wish to test/update and ddname1 is the libref you use in your program.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Sat May 16, 2020 3:02 pm    Post subject: Reply to: In JCL Procedure how we can execute REXX program
Reply with quote

Alternatively, instead of adding overhead (running the Rexx program) why not have a permanent concatenation of the dataset with the dummy record to the GDG dataset in the program that currently fails?

But the correct fix is to amend the failing program so that it will work with no records.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sun May 17, 2020 7:27 pm    Post subject:
Reply with quote

Or use IDCAMS and execute or not the following step from the return code issued by IDCAMS
Back to top
View user's profile Send private message
Dhananjayulu Neeli

New User


Joined: 15 May 2020
Posts: 2
Location: India

PostPosted: Mon May 18, 2020 12:23 am    Post subject: Reply to: In JCL Procedure how we can execute REXX program
Reply with quote

Thank you all for providing your valuable inputs. I have added one additional step in procedure to validate the file and tested the job. All working as expected.
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 Need help calling DB2 stored procedur... tuxama DB2 1 Thu Aug 13, 2020 6:14 pm
No new posts CA Sysview - JCL or Rexx - Read or Ex... Jasi CA Products 4 Wed Aug 05, 2020 9:19 pm
This topic is locked: you cannot edit posts or make replies. Invoke REXX thru JCL to expand the co... spizen556 CLIST & REXX 2 Sun Jul 26, 2020 3:53 pm
No new posts Unable to scroll in REXX panel KeshavKunal CLIST & REXX 4 Tue Jul 21, 2020 3:55 pm
No new posts REXX tool to extract all files starti... KeshavKunal CLIST & REXX 4 Tue Jul 21, 2020 3:43 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us