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

How to get the count in output


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

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Mon Mar 17, 2008 7:58 pm
Reply with quote

Hi,

Iam having a FB LRECL=80 file with records as follows

first 1 to 10 digits has account number zoned decimal (can have duplicates).
64th position will have a flag A or P.

I want to have the number of records of the same accounts with A as well as P in the output.
Is that possible to get it done using sort?

Eg:

0012345678 A
0012345678 P
0012345678 P
0012345678 P
0012345679 A
0012345679 A
0012345679 P
0012345679 P

Output File:
0012345678 A 1
0012345678 P 3
0012345679 A 2
0012345679 P 2

Thanks much for your time.

Regards
Tanden
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 17, 2008 8:54 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
0012345678 A
0012345678 P
0012345678 P
0012345678 P
0012345679 A
0012345679 A
0012345679 P
0012345679 P
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(1,12,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,12,
      TRAILER3=(1,12,X,COUNT=(EDIT=(IIT))))
/*
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Mon Mar 17, 2008 9:50 pm
Reply with quote

Hi Frank,

Thank you verymuch for your kind response.

Regards
Tanden
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 1
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top