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
 
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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

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