|
|
| Author |
Message |
kalaikala
New User
Joined: 21 Jul 2007 Posts: 19 Location: Chennai
|
|
|
|
Hi Frank Yaeger,
When I use below sort with empty file i am getting output as a space record.
| Code: |
SORT FIELDS=(01,05,CH,A,
06,05,CH,A,
11,10,CH,A,
21,10,CH,A),EQUALS
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(01,20,TRAILER3=(1,50))
|
Help me to ignore this space record. |
|
| Back to top |
|
 |
References
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4687 Location: San Jose, CA
|
|
|
|
Those control statements give you one blank TRAILER3 output record when SORTIN has no records.
| Quote: |
| Help me to ignore this space record. |
What do you mean by this? Do you want an empty output file when the input file is empty, or do you want something else? |
|
| Back to top |
|
 |
kalaikala
New User
Joined: 21 Jul 2007 Posts: 19 Location: Chennai
|
|
|
|
| I want an empty output file when the input file is empty. |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 399 Location: San Jose
|
|
|
|
kalaikala,
The following DFSORT/ICETOOL JCL will give you the desired results. The LAST parm on the SELECT operator does the same as the sections with trailer3. I also combined all your sort fields as 1 single field because they are continuous fields with the same format. Select operator has EQUALS as default
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=Your input file,
// DISP=SHR
//OUT DD DSN=Your output file,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,20,CH) LAST USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(01,30,CH,A)
OUTFIL FNAMES=OUT,BUILD=(1,50)
|
Hope this helps...
Cheers |
|
| Back to top |
|
 |
kalaikala
New User
Joined: 21 Jul 2007 Posts: 19 Location: Chennai
|
|
|
|
Thanks Skolusu!
Is it possible to solve this problem using the below SORT card itself?.
| Code: |
SORT FIELDS=(01,05,CH,A,
06,05,CH,A,
11,10,CH,A,
21,10,CH,A),EQUALS
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(01,20,TRAILER3=(1,50))
|
|
|
| Back to top |
|
 |
|
|
|