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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 5 Wed Jul 26, 2017 7:35 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


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