View previous topic :: View next topic
|
Author |
Message |
Dhananjayulu Neeli
New User
Joined: 15 May 2020 Posts: 2 Location: India
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Or use IDCAMS and execute or not the following step from the return code issued by IDCAMS |
|
Back to top |
|
|
Dhananjayulu Neeli
New User
Joined: 15 May 2020 Posts: 2 Location: India
|
|
|
|
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 |
|
|
|