IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

OUTPUT file with one Record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Tue May 10, 2011 4:00 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 10, 2011 4:07 pm
Reply with quote

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
View user's profile Send private message
Shriram Jogdand

New User


Joined: 14 Oct 2008
Posts: 65
Location: Pune

PostPosted: Tue May 10, 2011 4:22 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 10, 2011 4:41 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue May 10, 2011 9:15 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top