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

Count records using specific key using SORT


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

New User


Joined: 24 Jun 2009
Posts: 9
Location: India

PostPosted: Tue Nov 03, 2009 10:49 pm
Reply with quote

Hi,

I have unloaded data from DB2 table. Its in following order -

---------+---
AA_ACCT_NO
---------+---
9900000001.
9900000019.
9900000027.
9900000035.
9900010008.
9900010018.
9900010023.
9900010044.

I need output in following format -
990000* 4 (this should give count for records ranging from 9900000001 to 9900009999).
990001* 4
and so on til...
999999* 12

Input file attributes - VB LRECL-4092.

Is there any way I can do this using sort card. One of my colleage suggested following -
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(6,1,CH,EQ,C'9',AND,
6,6,ZD,GE,900000,AND,
6,6,ZD,LE,999999)
OUTREC BUILD=(1:1,14,20:SEQNUM,6,ZD,START=000001,INCR=1)

Using this i am getting output as -
990000000 000001
990000001 000002
990000002 000003
990000003 000004
990000004 000005
990000005 000006

This is not what I want icon_sad.gif.

Any help greatly appreciated.
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: Tue Nov 03, 2009 11:47 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for (I assumed your value starts in position 5 after the RDW):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VB)
//OUT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) NOHEADER BLANK NOCC -
  ON(5,6,CH) ON(VALCNT)
/*
Back to top
View user's profile Send private message
rohitnargunde

New User


Joined: 24 Jun 2009
Posts: 9
Location: India

PostPosted: Wed Nov 04, 2009 3:54 am
Reply with quote

thanks for the response. I will try this out tomorrow morning once i reach office. just wanted to check if syntaxt for DFSORT and ICETOOL will be different. As we do not use ICETOOL.

TIA, rohit
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: Wed Nov 04, 2009 4:04 am
Reply with quote

ICETOOL is part of DFSORT (since 1991). If you have DFSORT, you have ICETOOL.
Back to top
View user's profile Send private message
rohitnargunde

New User


Joined: 24 Jun 2009
Posts: 9
Location: India

PostPosted: Wed Nov 04, 2009 4:44 pm
Reply with quote

Thank you. I am able to get what I want.
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts count contained values of several col... DB2 5
No new posts DB2 Query to get the count of Unique ... DB2 2
No new posts Sort SMF records? SYNCSORT 6
Search our Forums:


Back to Top