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

Need a jcl utility to write a blank record to an empty file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jcbrowser

New User


Joined: 06 Oct 2005
Posts: 12

PostPosted: Wed Jan 10, 2007 8:22 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 10, 2007 8:56 pm
Reply with quote

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
View user's profile Send private message
jcbrowser

New User


Joined: 06 Oct 2005
Posts: 12

PostPosted: Wed Jan 10, 2007 9:35 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jan 10, 2007 9:58 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top