View previous topic :: View next topic
|
Author |
Message |
jcbrowser
New User
Joined: 06 Oct 2005 Posts: 12
|
|
|
|
I need to create a step in my jcl that will handle the following:
A previous step in my JCL proc has determined that a file is empty and sets a return code of 33.
All other steps int the PROC are currently bypassed when the file is empty.
What I need to do is create a blank record and write it to the file when the return code of 33 is detected.
Changing the program that sets the return code is not an option.
This method would have to be as generic as possible. My PROC is used in different jobs for files with different record lengths. I don't want to have to create dummy files for each job.
The utility or method would have to take the file as input and create and write a blank record to the file without a dummy file as input.
This is how I invision the step in my PROC (all I need is the utility):
//STEP01 ... this is the step that returns a cond of 33 when file is empty
.
.
.
I will add the following after STEP01
// IF RC = 33 THEN
//STEP01A EXEC special utility
//SYSUT1 DD DSN=file from step01,DISP=SHR
//SYSUT2 DD DSN=file from step01,DISP=SHR
//SYSIN DD DSN=CTRLCARD.LIB(member to instruct utility to create blank record based on cataloged record length of SYSUT1 file)
// ENDIF
Is there a way to do this?
Thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Why not use DFSORT?
Code: |
// IF RC = 33 THEN
//STEP01A EXEC PGM=ICEMAN
//SORTIN DD DSN=file from step01,DISP=SHR
//SORTOUT DD DSN=file to be empty,DISP=....
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=ALL
/*
// ENDIF
|
|
|
Back to top |
|
|
jcbrowser
New User
Joined: 06 Oct 2005 Posts: 12
|
|
|
|
I'm new to forums. I not sure this will go to user superk, but here goes.
The DFSORT solution you sent me will empty a file. I need something to put a blank record to a file that is already empty.
Do you know how I cando that?
Thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Try this one small change:
Code: |
// IF RC = 33 THEN
//STEP01A EXEC PGM=ICEMAN
//SORTIN DD DSN=file from step01,DISP=SHR
//SORTOUT DD DSN=file to be empty,DISP=....
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=ALL
OUTFIL TRAILER1=(1:X),NODETAIL,REMOVECC
/*
// ENDIF
|
|
|
Back to top |
|
|
|