|
View previous topic :: View next topic
|
| Author |
Message |
rohitnargunde
New User
Joined: 24 Jun 2009 Posts: 9 Location: India
|
|
|
|
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 .
Any help greatly appreciated. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
rohitnargunde
New User
Joined: 24 Jun 2009 Posts: 9 Location: India
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| ICETOOL is part of DFSORT (since 1991). If you have DFSORT, you have ICETOOL. |
|
| Back to top |
|
 |
rohitnargunde
New User
Joined: 24 Jun 2009 Posts: 9 Location: India
|
|
|
|
| Thank you. I am able to get what I want. |
|
| Back to top |
|
 |
|
|