View previous topic :: View next topic
|
Author |
Message |
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Hi all,
I am using the below sort card in one the steps in JCL.
SORT FIELDS=(1,10,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,10,
TRAILER3=(1,10,X,COUNT=(M11,LENGTH=9)))
Its working fine when there are some records in Input but its giving one output record even when the input file is empty.
Output record
000000000
(Nine zeros at the position of count) Where as I would like to have the output as empty in above case.
I am new to SORT and would appreciate help on this.
-thanks
David P. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
TRAILER3 is supposed to write a record even when the input file is empty.
You can easily eliminate that record when the count is all 0's with a DFSORT/ICETOOL job like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
SORT FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,10,CH,A)
OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
SECTIONS=(1,10,
TRAILER3=(1,10,X,COUNT=(M11,LENGTH=9)))
/*
//CTL2CNTL DD *
OMIT COND=(12,9,ZD,EQ,+0)
/*
|
|
|
Back to top |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
Thanks Frank for your quick response.
-David P. |
|
Back to top |
|
|
|
|