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

Count the number of OMITTED records using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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: 355
Location: New York

PostPosted: Mon May 25, 2009 5:44 pm
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
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
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: 355
Location: New York

PostPosted: Tue May 26, 2009 9:32 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts DFSORT GUID DFSORT/ICETOOL 3
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
Search our Forums:

Back to Top