View previous topic :: View next topic
|
Author |
Message |
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi All,
I have the following input file.
Code: |
42501131383 ap
42501131457 ap
42501131644 ap
42501133172 tn
42501133248 tn
42501135032 tn
42501135333 wb
42501137367 wb
42501137835 wb
42501138553 wb
|
first 11 bytes is a unique#,1byte space, 2byte state code(14 byte file).
i need the count per state. i.e.
count for ap=3
count for tn=3
count for wb=4
can anyone tell me how to get this count.
thanks, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
This may help,
Code: |
//ICETOOL1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD DSN=
//OUFILE DD SYSOUT=*
//TOOLIN DD *
OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2CH) ON(VALCNT)
/*
|
|
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
I got the below error msg:
Quote: |
SYT215E "ON" LENGTH IS NOT 1 TO 1500
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Sorry, typo
Code: |
OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2CH) ON(VALCNT) |
Should be
Code: |
OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2,CH) ON(VALCNT) |
|
|
Back to top |
|
|
Sachinrethin
New User
Joined: 12 Oct 2007 Posts: 21 Location: Chennai
|
|
|
|
Hi,
Another way to do this... just a try..
INREC OVERLAY=(81:C'000000001')
SORT FIELDS=(13,2,CH,A)
SUM FIELDS=(81,9,ZD)
OUTREC BUILD=(13,2,81,9,ZD,EDIT=(IIIIIIIIT),69X)
and got the output as,
ap 3
tn 3
wb 4 |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Arvind,
Here is another alternative:
Code: |
//SORT1 EXEC PGM=SORT
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
42501131383 AP
42501131457 AP
42501131644 AP
42501133172 TN
42501133248 TN
42501135032 TN
42501135333 WB
42501137367 WB
42501137835 WB
42501138553 WB
//SYSIN DD *
SORT FIELDS=(13,2,CH,A)
OUTFIL FILES=OUT,SECTIONS=(13,2,
TRAILER3=(C'COUNT FOR ',13,2,C'=',
COUNT=(EDIT=(IIIT)))),
REMOVECC,NODETAIL
/*
|
The output produced is as follows:
Code: |
COUNT FOR AP= 3
COUNT FOR TN= 3
COUNT FOR WB= 4 |
|
|
Back to top |
|
|
|