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
 
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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