Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Count the number of OMITTED records using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
chinnielr

New User


Joined: 11 Jul 2005
Posts: 87

PostPosted: Mon May 25, 2009 3:55 pm    Post subject: Count the number of OMITTED records using DFSORT
Reply with quote

Hi,

I have an I/P file LRECL=200, RECFM=FB

My sort card looks like below

OMIT COND=(02,09,ZD,EQ,345623211)
SORT FIELDS=COPY

I have a field in I/P file OUT-COUNT 9(8) starting at 192 and length of 9 bytes. OUT-COUNT field should contain the number of output records.

If my I/P file has 500 records and the number of records OMITTED using te above sort is 200 and the O/P file should contain 300 records.

I need the OUT-COUNT should be populated with 300. How can I achieve this using DFSORT.

Please tell me how to modify the above same sort card to achieve this.

Thanks in adavance.
Back to top
View user's profile Send private message

bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Mon May 25, 2009 4:43 pm    Post subject:
Reply with quote

You can use the keyword 'COUNT' along with the outrec statement which will gives you the number of records which copied from input to output..
Regards,
Bipin Peter
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Mon May 25, 2009 5:44 pm    Post subject:
Reply with quote

How do you want the count? You want to write total count in Trailer record or record count of each record has to be written in the output incrementing 1 by 1.

e.g., in first record field value '1'
in second record '2' and so on....
Back to top
View user's profile Send private message
chinnielr

New User


Joined: 11 Jul 2005
Posts: 87

PostPosted: Mon May 25, 2009 6:08 pm    Post subject: Reply to: Count the number of OMITTED records using DFSORT
Reply with quote

Hi,

Thanks for your reply.

I want the number of O/P records to be populated in one of the I/P file field OUT-COUNT

My OUT-COUNT should be populated 300 (if I/P file has 500 records and 300 is the O/P of the DFSORT).

OUT-COUNT is of PIC 9(8) which I has mentioned earlier.

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 26, 2009 1:24 am    Post subject:
Reply with quote

Hi chinnielr,

is OUT-COUNT field is only in trailer and to be updated with number of records in output?
or OUT-COUNT is part of every detail line of the file.

It would be better if you show us sample file and expected output file.

Quote:

Please help!!!

of-course they will.
but only if you give proper details of your requirement. icon_smile.gif
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Tue May 26, 2009 9:32 am    Post subject:
Reply with quote

You have not provided asked info but below solution provides you the count in trailer record.

Code:

//CTRCDS EXEC PGM=ICEMAN                                 
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD DSN=input file............,DISP=SHR           
//SORTOUT DD DSN=output file.......,DISP=(NEW,CATLG,DELETE)   
//SYSIN DD *                                             
 SORT FIELDS=COPY                   
 OMIT COND=(02,09,ZD,EQ,345623211)
 OUTFIL FNAMES=SORTOUT,             
 OUTREC=(1,200),                   
 TRAILER1=(192:COUNT=(M11,LENGTH=9))
/*                                                       


Above code you give the number of records in the output file in trailer recrd from position 192-200.

If you need something else, show us with examples.
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 CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us