Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
OUTPUT file with one Record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: OUTPUT file with one Record
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    Post subject:
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    Post subject: Reply to: OUTPUT file with one Record
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    Post subject:
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    Post subject: Reply to: OUTPUT file with one Record
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us