View previous topic :: View next topic
|
Author |
Message |
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
Raymond Sachs
New User
Joined: 13 Dec 2007 Posts: 45 Location: USA
|
|
|
|
Thanks for the update |
|
Back to top |
|
|
|