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

Empty file and Literal presence in one step?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Feb 10, 2011 5:24 am
Reply with quote

Dear listers,
Can we combine two individual steps where I am using a REPRO with COUNT(1) and then a subsequent SORT with a check for the literal 'NO DATA' to achieve the same result.

Requirement: If the File is empty or has one record with "NO DATA" we need to create an empty file of LRECL = 100.

Code:
  REPRO INFILE(INDD) OUTFILE(OUTDD) COUNT(1)


Code:
OMIT COND=(10,7,CH,EQ,C'NO DATA')   
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Feb 10, 2011 6:21 am
Reply with quote

The COUNT operator of DFSORT's ICETOOL can do the equivalent of REPRO with COUNT(1). COUNT can also use INCLUDE. So you could probably do what you want in one ICETOOL step.

For more information on using the DFSORT's COUNT operator, see the "Set RC=12 or RC=4 if file is empty, has more than n records, etc" Smart DFSORT Trick at:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Feb 10, 2011 6:59 am
Reply with quote

Hi Frank,

That worked! Let me see if I can add another level of complexity. Instead of setting a RC=04 and then using that conditional code to create a dataset, can it be done in the same step? So, if we encounter an empty file or a "NO DATA" Header record, I need to create an dataset (will be used by another system)

COUNT FROM(INPUT) EMPTY USING(HDTL) RC4
OMIT COND=(80,7,CH,EQ,C'NO DATA')

Eventhough, we are a SYNCSORT shop, it seems to work via some interface
Code:

SYT000I  SYNCTOOL RELEASE 1.6.2 - COPYRIGHT 2007  SYNCSORT INC. 
SYT001I  INITIAL PROCESSING MODE IS "STOP"                       
SYT002I  "TOOLIN" INTERFACE BEING USED                           
                                                                 
          COUNT FROM(INPUT) EMPTY USING(HDTL) RC4               
SYT020I  SYNCSORT CALLED WITH IDENTIFIER "0001"                 
SYT075I  CONDITION FOR RECORD COUNT SATISFIED - RC=4 SET         
SYT030I  OPERATION COMPLETED WITH RETURN CODE 4                 
                                                                 
SYT004I  SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 04       
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Feb 10, 2011 7:35 am
Reply with quote

Raymond Sachs,

Frank answers questions on DFSORT as he is a DFSORT developer. Since some of the control statements work the same way in SYNCTOOL, you were able to run your SYNCTOOL job.

I dont think it's possible to include your empty file creation also into the above job. You got the RC=4 SET based on the input conditions, now you're good to use it in your next step to do whatever you want.
Back to top
View user's profile Send private message
Raymond Sachs

New User


Joined: 13 Dec 2007
Posts: 45
Location: USA

PostPosted: Thu Feb 10, 2011 7:46 am
Reply with quote

Thanks for the update
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top