f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000256895smith country store
f01000258647jemes tailor outlet
f01000258647jemes tailor outlet
f01000258647jemes tailor outlet
f01000258647jemes tailor outlet
f01000258647jemes tailor outlet
f01000258647jemes tailor outlet
f01000315258williams penn supply
f02000315258williams penn supply
f02000315258williams penn supply
f02000315258williams penn supply
f02000315258williams penn supply
f02000315258williams penn supply
f02000315258williams penn supply
f03000312856santorinis trattoria
f03000312856santorinis trattoria
ACTUALT OUTPUT:
Code:
f01000256895smith country store 055
f01000258647jemes tailor outlet 081
f01000315258williams penn supply 017
f02000315258williams penn supply 123
f03000312856santorinis trattoria 049
EXPECTED OUTPUT:
Code:
f01000256895smith country store 10
f01000258647jemes tailor outlet 6
f01000315258williams penn supply 1
f02000315258williams penn supply 6
f03000312856santorinis trattoria 2
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Tue Jan 13, 2009 11:12 am Post subject:
rama krishna reddy,
Your approach itself is wrong. You want to count the no: of occurrences for each key. SEQNUM specifies a ascending sequence number for each record. so the first record will have a number 1 and the second will have a number 2 and so on. Since you created only a 3 byte sequence and summing on it an overflow condition occurred. ie the summation exceed 1000 and you only have 3 bytes to store that value.
The simplest way to do it is using SECTIONS and TRAILER3
f01000256895smith country store 10
f01000258647jemes tailor outlet 6
f01000315258williams penn supply 1
TOTAL 00017
f02000315258williams penn supply 6
TOTAL 00006
f03000312856santorinis trattoria 2
TOTAL 00002
s01000214558berkely baits 7
TOTAL 00007
s02000265995federal ammunition 11
TOTAL 00011
s03000312856federal ammunition 6
TOTAL 00006
---------------------
I want to find the sum for the record having same value in 2,2 position
Expected Output:
Code:
f01000256895smith country store 10
f01000258647jemes tailor outlet 6
f01000315258williams penn supply 1
TOTAL 00017
f02000315258williams penn supply 6
TOTAL 00006
f03000312856santorinis trattoria 2
TOTAL 00002
s01000214558berkely baits 7
TOTAL 00007
s02000265995federal ammunition 11
TOTAL 00011
s03000312856federal ammunition 6
TOTAL 00006
TOTAL PLANS
well-1 24 (i.e 17 for f01 + 7 for s01)
well-2 17 (i.e 6 for f02 + 11 for s02 )
well-3 8 (i.e 2 for f03 + 6 for s03)
I need report link above
In case if i use sort fields on 2,2 char then s01 records will come after f01 but i want all f records first and then s records
and total count for records with
Code:
01
02
03
04
in the 2,2 position
Iam trying to find the solution Can You please help me regarding the same.
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Thu Jan 15, 2009 11:39 am Post subject:
rama krishna reddy,
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000256895SMITH COUNTRY STORE
F01000258647JEMES TAILOR OUTLET
F01000258647JEMES TAILOR OUTLET
F01000258647JEMES TAILOR OUTLET
F01000258647JEMES TAILOR OUTLET
F01000258647JEMES TAILOR OUTLET
F01000258647JEMES TAILOR OUTLET
F01000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F02000315258WILLIAMS PENN SUPPLY
F03000312856SANTORINIS TRATTORIA
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000256895BARABARA MACDONALD
S01000258647 RAMA KRISHNA REDDY
S01000258647 RAMA KRISHNA REDDY
S01000258647 RAMA KRISHNA REDDY
S01000258647 RAMA KRISHNA REDDY
S01000258647 RAMA KRISHNA REDDY
S01000315258 HARDEWARE STORE
S01000315258 HARDEWARE STORE
S01000315258 HARDEWARE STORE
S03000312856 PAINT STORE
S03000312856 PAINT STORE
S03000312856 PAINT STORE
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,35,7C'0',C'1'))
SORT FIELDS=(1,12,CH,A)
SUM FIELDS=(36,8,ZD)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum