|
View previous topic :: View next topic
|
| Author |
Message |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi,
I want to sort the file and want to create 2 output file depending on certain conditions. I am able to do this.
Now, I want that each o/p file should have only one record. that means I want to stop processing after both the o/p files have one records each.
I know SKIPREC and STOPAFT but they are applicable to input file and not to output files. Please help. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use
| Code: |
| OUTFIL ENDREC=1,.... |
For precise answer.. .
Provide precise details...
1: Input file sample records, RECFM, LRECL
2: Output file sample output, RECFM, LRECL
And well.. SORT product also.. but I assume you have correctly posted into DFSORT forum as you are quite old to forum.. |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Input file have records with first 2 bytes as 00,10,20,30,40, etc.
I have written code as
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,
INCLUDE=(001,02,CH,EQ,C'10')
OUTFIL FNAMES=SORTOUT2,
INCLUDE=(001,02,CH,EQ,C'20')
Now I want only one record in o/p files SORTOUT1 and SORTOUT2.
I changed sort fileds=copy with below code
OPTION COPY,STOPAFT=1
The result is not coming properly. I think STOPAFT=1 is reading only one record of the input file and dont have effect with the no. of records of the o/p file.
Hope this will clarify my requirement and question. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below should give you desired output..
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00
10 A
10 B
10 C
20 A
20 B
20 C
30
40
//OUT10 DD SYSOUT=*
//OUT20 DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS
INCLUDE COND=(1,2,CH,EQ,C'10',OR,1,2,CH,EQ,C'20')
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=(NONE)
OUTFIL FNAMES=OUT10,INCLUDE=(1,2,CH,EQ,C'10')
OUTFIL FNAMES=OUT20,INCLUDE=(1,2,CH,EQ,C'20')
/*
|
Let us know if this suffice your requirement.[/code] |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Shriram Jogdand,
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), DFSORT now has OUTFIL ACCEPT=n which lets you control as to how many records you want in the OUTFIL file.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00
10 A
10 B
10 C
20 A
20 B
20 C
30
40
//SORTOUT1 DD SYSOUT=*
//SORTOUT2 DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(1,2,SS,EQ,C'10,20')
OPTION COPY
OUTFIL FNAMES=SORTOUT1,ACCEPT=1,INCLUDE=(1,2,CH,EQ,C'10')
OUTFIL FNAMES=SORTOUT2,ACCEPT=1,INCLUDE=(1,2,CH,EQ,C'20')
//* |
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|