Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need a jcl utility to write a blank record to an empty file
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

Moderator Team Head


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

PostPosted: Wed Jan 10, 2007 8:56 pm    Post subject: Re: Need a jcl utility to write a blank record to an empty f
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Jan 10, 2007 9:58 pm    Post subject: Re: Need a jcl utility to write a blank record to an empty f
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us