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
 

 

Empty file and Literal presence in one step?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Empty file and Literal presence in one step?
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 Moderator


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

PostPosted: Thu Feb 10, 2011 6:21 am    Post subject:
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:

http://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    Post subject:
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: 2284
Location: @my desk

PostPosted: Thu Feb 10, 2011 7:35 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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