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
 

 

Count records using specific key using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Count records using specific key using SORT
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 Moderator


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

PostPosted: Tue Nov 03, 2009 11:47 pm    Post subject:
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    Post subject: Reply to: Count records using specific key using SORT
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 Moderator


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

PostPosted: Wed Nov 04, 2009 4:04 am    Post subject:
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    Post subject: Reply to: Count records using specific key using SORT
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    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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


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