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

In JCL Procedure how we can execute REXX program


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 1306
Location: Vilnius, Lithuania

PostPosted: Sat May 16, 2020 12:53 am
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

Global Moderator


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

PostPosted: Sat May 16, 2020 2:08 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sat May 16, 2020 2:11 am
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 Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat May 16, 2020 2:35 pm
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: 2455
Location: Hampshire, UK

PostPosted: Sat May 16, 2020 3:02 pm
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: 8797
Location: Welsh Wales

PostPosted: Sun May 17, 2020 7:27 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
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