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
 

 

How to get the count in output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to get the count in output
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 Moderator


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

PostPosted: Mon Mar 17, 2008 8:54 pm    Post subject:
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    Post subject: Reply to: How to get the count in output
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    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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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