Help with Icetool, Splice, Sum and Calculate complex sort
- claywilly
- Posts: 26
- Joined: Sat Jun 14, 2008 12:01 am
- Skillset: Medium expert in all IBM mainframe stuff.
- Referer: mvshelp.net
Re: Help with Icetool, Splice, Sum and Calculate complex sort
I really appreciate your patience.
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Help with Icetool, Splice, Sum and Calculate complex sort
I've been answering questions all day and I have to get on to some other work. I've asked Kolusu to take a look at this and see if he can help. He has a lot more patience and tenacity than I do for these kinds of complex questions (and he's very clever too).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
- claywilly
- Posts: 26
- Joined: Sat Jun 14, 2008 12:01 am
- Skillset: Medium expert in all IBM mainframe stuff.
- Referer: mvshelp.net
Re: Help with Icetool, Splice, Sum and Calculate complex sort
I wish him luck.
BTW. The JCL code that was posted awhile back does work. We just need to splice things together... unless there is a different approach altogether.
thanks again.
BTW. The JCL code that was posted awhile back does work. We just need to splice things together... unless there is a different approach altogether.
thanks again.
Re: Help with Icetool, Splice, Sum and Calculate complex sort
The following DFSORT/ICETOOL JCL will give you the desired results. You only showed me the output you wanted for final output but not for the nomatch file. I just assumed that you only wanted the data that is present in OPVL file. Make sure to have disp=MOD for the file T1
The out file will have
The nomatch will have
if you need a different output for nomatch file let me know and I will create it
Hope this helps...
Cheers
Code: Select all
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//PSAM DD DSN=INPUT.PSAM,DISP=SHR
//OPVL DD DSN=INPUT.OPVL,DISP=SHR
//OPPH DD DSN=INPUT.OPPH,DISP=SHR
//TEMP DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(60,20),RLSE)
//OUT DD SYSOUT=*
//NOMATCH DD SYSOUT=*
//TOOLIN DD *
COPY FROM(PSAM) TO(TEMP) USING(CTL1)
SORT FROM(OPVL) TO(TEMP) USING(CTL2)
SORT FROM(OPPH) TO(TEMP) USING(CTL3)
SORT FROM(TEMP) USING(CTL4)
//CTL1CNTL DD *
OUTREC BUILD=(01:1,11,
13:82,10,
24:92,16,SFF,ZD,LENGTH=15,
40:+0,TO=ZD,LENGTH=15,
56:+0,TO=ZD,LENGTH=15,
90:C'100')
/*
//CTL2CNTL DD *
INCLUDE COND=(182,2,CH,EQ,C'PN')
SORT FIELDS=(182,16,CH,A)
OUTFIL FNAMES=TEMP,NODETAIL,REMOVECC,BUILD=(92X),
SECTIONS=(182,16,
TRAILER3=(01:187,11,
13:146,10,
40:TOT=(101,16,SFF,ZD,LENGTH=15),
56:15C'0',
90:C'010'))
/*
//CTL3CNTL DD *
INCLUDE COND=(131,11,CH,NE,C' ')
SORT FIELDS=(131,11,CH,A)
OUTFIL FNAMES=TEMP,NODETAIL,REMOVECC,BUILD=(92X),
SECTIONS=(131,11,
TRAILER3=(01:131,11,
40:15C'0',
56:TOT=(291,16,SFF,ZD,LENGTH=15),
90:C'001'))
/*
//CTL4CNTL DD *
OPTION EQUALS
INREC OVERLAY=(94:7C'0',C'1')
SORT FIELDS=(1,11,CH,A)
SUM FIELDS=(40,15,ZD,56,15,ZD,90,3,ZD,94,8,ZD)
OUTFIL FNAMES=OUT,INCLUDE=(90,3,ZD,GT,100),REMOVECC,
BUILD=(01:01,23,
24:24,15,ZD,EDIT=(SIIIIIIIIIIIT.TT),SIGNS=(+,-),
40:40,15,ZD,EDIT=(SIIIIIIIIIIIT.TT),SIGNS=(+,-),
56:56,15,ZD,EDIT=(SIIIIIIIIIIIT.TT),SIGNS=(+,-),
72:24,15,ZD,SUB,40,15,ZD,SUB,56,15,ZD,
EDIT=(SIIIIIIIIIIIT.TT),SIGNS=(+,-)),
HEADER1=(01:'PA NUMBER',
15:'END DATE ',
28:'AUTH. AMOUNT',
41:'OPVL CLOSED AMT',
59:'OPPH EXPD AMT',
77:'REM.BALANCE')
OUTFIL FNAMES=NOMATCH,REMOVECC,
INCLUDE=(90,1,ZD,EQ,0,AND,91,1,ZD,EQ,1),
BUILD=(01:01,23,
24:40,15,ZD,EDIT=(SIIIIIIIIIIIT.TT),SIGNS=(+,-)),
HEADER1=(01:'PA NUMBER',
15:'END DATE ',
28:'AUTH. AMOUNT')
/*
The out file will have
Code: Select all
PA Number End Date Auth. Amount OPVL Closed Amt. OPPH Expended Amt. Rem.Balance
D0000000020 03/31/1997 +47000.00 +0.00 +17319.30 +29680.70
D0000000022 04/30/1995 +100000.00 +0.00 +3276.50 +96723.50
D0000000023 04/30/1998 +18000.00 +0.00 +1838.20 +16161.80
N1000003319 11/15/1997 +750000.00 +128.46 +0.00 +749871.54
The nomatch will have
Code: Select all
PA NUMBER END DATE AUTH. AMOUNT
F2000002042 07/30/2008 +64550.00
N1000003488 02/22/2007 +3629.25
N1000004520 02/15/2008 +46099.66
N1000007362 01/10/2008 +71642.94
N1000009176 11/25/2003 +277.45
N3000001358 02/21/2006 +326.38
X4000000219 05/29/2002 +884.17
if you need a different output for nomatch file let me know and I will create it
Hope this helps...
Cheers
- claywilly
- Posts: 26
- Joined: Sat Jun 14, 2008 12:01 am
- Skillset: Medium expert in all IBM mainframe stuff.
- Referer: mvshelp.net
Re: Help with Icetool, Splice, Sum and Calculate complex sort
Hi Skolusu,
I am getting all zero amounts in the OPVL Closed Amount field and no records in the NoMatch file.
I am looking into it.
If you notice something before I do, please let me know..
Other than that, It looks great!
Thanks.
I am getting all zero amounts in the OPVL Closed Amount field and no records in the NoMatch file.
I am looking into it.
If you notice something before I do, please let me know..
Other than that, It looks great!
Thanks.
Re: Help with Icetool, Splice, Sum and Calculate complex sor
claywilly,
I used the sample data you supplied in this post
dfsort-icetool-icegener/topic1130-10.html#p4269
You should have atleast found N1000003319 having 128.46 in the OVPL Closed amount column
If you want to check for the nonmatch records change CTL4CNTL to the following and rerun the job and see the contents at pos 90. If you find a record with 010 or 011 , they are your unmatched records
Kolusu
I used the sample data you supplied in this post
dfsort-icetool-icegener/topic1130-10.html#p4269
You should have atleast found N1000003319 having 128.46 in the OVPL Closed amount column
If you want to check for the nonmatch records change CTL4CNTL to the following and rerun the job and see the contents at pos 90. If you find a record with 010 or 011 , they are your unmatched records
Code: Select all
//CTL4CNTL DD *
OPTION EQUALS
INREC OVERLAY=(94:7C'0',C'1')
SORT FIELDS=(1,11,CH,A)
SUM FIELDS=(40,15,ZD,56,15,ZD,90,3,ZD,94,8,ZD)
OUTFIL FNAMES=OUT
/*
Kolusu
- claywilly
- Posts: 26
- Joined: Sat Jun 14, 2008 12:01 am
- Skillset: Medium expert in all IBM mainframe stuff.
- Referer: mvshelp.net
Re: Help with Icetool, Splice, Sum and Calculate complex sort
Ok. I found the problem.
In an earlier post I had the PN number position at 182, this should have been 187. My mistake.
I adjusted the code and the job ran with the expected results.
Here is the code I changed:
The "182" was changed to "187" and the "187" was changed to "192".
Now I am getting the correct amounts in the OPVL CLosed Amount and
a ton of records in the NoMatch file.
I really appreciate both you and Frank for all your hard efforts.
Once again you have helped me tremendously.
Thanks again.
In an earlier post I had the PN number position at 182, this should have been 187. My mistake.
I adjusted the code and the job ran with the expected results.
Here is the code I changed:
Code: Select all
//CTL2CNTL DD *
INCLUDE COND=(187,2,CH,EQ,C'PN')
SORT FIELDS=(187,16,CH,A)
OUTFIL FNAMES=TEMP,NODETAIL,REMOVECC,BUILD=(92X),
SECTIONS=(187,16,
TRAILER3=(01:192,11,
13:146,10,
40:TOT=(101,16,SFF,ZD,LENGTH=15),
56:15C'0',
90:C'010'))
The "182" was changed to "187" and the "187" was changed to "192".
Now I am getting the correct amounts in the OPVL CLosed Amount and
a ton of records in the NoMatch file.
I really appreciate both you and Frank for all your hard efforts.
Once again you have helped me tremendously.
Thanks again.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Splice JCL into one record for DD statement parms
by phcribb » Thu Nov 05, 2020 9:31 pm » in CLIST & REXX - 3
- 1966
-
by phcribb
View the latest post
Fri Nov 06, 2020 8:06 pm
-
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1568
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
- 2
- 1446
-
by willy jensen
View the latest post
Sun Nov 13, 2022 9:02 pm
-
-
Continuation of report in ICETOOL
by schintala » Sat Dec 24, 2022 10:32 pm » in DFSORT/ICETOOL/ICEGENER - 7
- 3048
-
by sergeyken
View the latest post
Fri Dec 30, 2022 12:27 am
-
-
- 1
- 1780
-
by prino
View the latest post
Tue Jul 02, 2024 2:23 pm