Unable to achieve below scenario using ICETOOL
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 12
- Joined: Sun Aug 22, 2010 1:57 am
Position representation of xxxx, yyyy in my earlier post have been changed...
Here are proper explanations of xxxx/yyyy if my earlier post explanation was not clear
T1 output file:
BALANCE: HEAD-1111:xxxx 1111:yyyy
xxxx-> Input HEADER segment count value (i.e 13,4 in input file and 21,4 in ICETOOL)
yyyy-> Calculated count in ICETOOL i.e. position 37,4
Here are proper explanations of xxxx/yyyy if my earlier post explanation was not clear
T1 output file:
BALANCE: HEAD-1111:xxxx 1111:yyyy
xxxx-> Input HEADER segment count value (i.e 13,4 in input file and 21,4 in ICETOOL)
yyyy-> Calculated count in ICETOOL i.e. position 37,4
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
I can't make much sense out of what you're telling me.
Here's what I see which I think relates to your question:
You have A003 in your HEADER - this is NOT a valid numeric.
You move A003 to position 100-103 - A003 is still NOT a valid numeric.
You do a TOT with UFF for the value A003 which is still NOT a valid numeric. UFF treats A003 as 0003 since it only extracts valid decimal digits and A is NOT a valid decimal digit.
I don't know what it is you're trying to do. What does A003 represent? How can you expect to total a non-numeric value correctly? If you're trying to treat A003 as a binary value (X'C1F0F0F3') rather than as a numeric value, use BI instead of UFF.
Here's what I see which I think relates to your question:
Code: Select all
HEADER 1111A003
Code: Select all
IFTHEN=(WHEN=(1,6,CH,EQ,C'HEADER'),
OVERLAY=(100:13,4,
104:C'0000'),HIT=NEXT),
Code: Select all
11:'HEAD-1111:',21:TOT=(100,4,UFF,TO=ZD,LENGTH=4),
I don't know what it is you're trying to do. What does A003 represent? How can you expect to total a non-numeric value correctly? If you're trying to treat A003 as a binary value (X'C1F0F0F3') rather than as a numeric value, use BI instead of UFF.
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
-
- Member
- Posts: 12
- Joined: Sun Aug 22, 2010 1:57 am
Frank,
We are almost on the same page.
I agree with you that value A003 is NOT a valid numeric value. But as one of my test cases, I wanted to test the numeric field with junk or alpha numerics. As i don't have any control on the input file, I am assuming that there might be a chance for some junk or alphanumeric values to be written in to this numeric field.
Now considering that the numeric field has a alpha numeric value like A, the TOT function should not treat A003 as 0003. It should say that there is a unacceptable value in numeric field and it should abend.
I am testing the ICETOOL code that i shared earlier with all possible cases to fail the job. So when there is alpha numeric value, the TOT function should not replace it with zero or other numeric value. It should fail.
Please let me know if there is a way to make TOT function read A003 as A003 only and fail.
Note : To satisfy the above condition,is it must to use Binary instead of UFF? IN this case, I am afraid, I am not aware of the initial values to be defined. Like in UFF, i defined the intial values as C'0000' in UFF. If i should change all UFF/SFF to BI, then could you please help me in changing the ICETOOL code. Also, please note that the incoming data is ZD. So even the input should be converted to BI before proceeding with comparsions.
We are almost on the same page.
I agree with you that value A003 is NOT a valid numeric value. But as one of my test cases, I wanted to test the numeric field with junk or alpha numerics. As i don't have any control on the input file, I am assuming that there might be a chance for some junk or alphanumeric values to be written in to this numeric field.
Now considering that the numeric field has a alpha numeric value like A, the TOT function should not treat A003 as 0003. It should say that there is a unacceptable value in numeric field and it should abend.
I am testing the ICETOOL code that i shared earlier with all possible cases to fail the job. So when there is alpha numeric value, the TOT function should not replace it with zero or other numeric value. It should fail.
Please let me know if there is a way to make TOT function read A003 as A003 only and fail.
Note : To satisfy the above condition,is it must to use Binary instead of UFF? IN this case, I am afraid, I am not aware of the initial values to be defined. Like in UFF, i defined the intial values as C'0000' in UFF. If i should change all UFF/SFF to BI, then could you please help me in changing the ICETOOL code. Also, please note that the incoming data is ZD. So even the input should be converted to BI before proceeding with comparsions.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
TOT will NOT ABEND or terminate for a 'A003' value - it just interprets it correctly, as documented, for the format you select.Now considering that the numeric field has a alpha numeric value like A, the TOT function should not treat A003 as 0003. It should say that there is a unacceptable value in numeric field and it should abend.
If you want to terminate for an invalid numeric, you can probably figure out a way to do that using DFSORT's NUM function with OUTFIL and NULLOUT=RC16. For more information, see:
http://www.ibm.com/support/docview.wss? ... g3T7000086
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
-
- Member
- Posts: 12
- Joined: Sun Aug 22, 2010 1:57 am
Ok Frank...
So in that case, i am planning to use below steps to complete the process with RC4 in case if non numerics found in the input data in the HEADER record...
TOOLIN DD *
SORT FROM(INP01) TO (T1) USING(CTL1)
COUNT FROM(T1) NOTEQUAL(0) RC4
CTL1CNTL DD *
SORT FIELDS=COPY
INCLUDE COND=((9,4,CH,EQ,'1111'),AND,(13,4,FS,NE,NUM))
So for the sample input file we were discussing, process would complete with RC4.
If you remember, sample input file also had -9(6).99 in the HEADER record in position 29,10 i.e.
Sample Input data-
HEADER 11110003222200023333 30.00
1111
1111
1111
1114
2222
2222
2224
3333 10.00
3333 10.00
3333 10.00
4444
Could you please suggest the format to be used in INCLUDE COND to check for valid numeric data in this -9(6).99 field.
So in that case, i am planning to use below steps to complete the process with RC4 in case if non numerics found in the input data in the HEADER record...
TOOLIN DD *
SORT FROM(INP01) TO (T1) USING(CTL1)
COUNT FROM(T1) NOTEQUAL(0) RC4
CTL1CNTL DD *
SORT FIELDS=COPY
INCLUDE COND=((9,4,CH,EQ,'1111'),AND,(13,4,FS,NE,NUM))
So for the sample input file we were discussing, process would complete with RC4.
If you remember, sample input file also had -9(6).99 in the HEADER record in position 29,10 i.e.
Sample Input data-
HEADER 11110003222200023333 30.00
1111
1111
1111
1114
2222
2222
2224
3333 10.00
3333 10.00
3333 10.00
4444
Could you please suggest the format to be used in INCLUDE COND to check for valid numeric data in this -9(6).99 field.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
NUM can be used with standard character (FS), ZD and PD numeric values. It does NOT handle other numeric types including those with decimal points and leading signs.
Since you don't use code tags, I can't tell what your input data really looks like.
Show me what the -9(6).99 values look like for the maximum + value, a zero value and the maximum - value. Show each leading blank as a b. Show each leading zero. For example, something like:
+999999.99
bbbbbb+0.00
-9999999.99
or whatever it actually looks like.
Tell me the rules for determining if a numeric of this form is valid or invalid.
Since you don't use code tags, I can't tell what your input data really looks like.
Show me what the -9(6).99 values look like for the maximum + value, a zero value and the maximum - value. Show each leading blank as a b. Show each leading zero. For example, something like:
+999999.99
bbbbbb+0.00
-9999999.99
or whatever it actually looks like.
Tell me the rules for determining if a numeric of this form is valid or invalid.
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
-
- Member
- Posts: 12
- Joined: Sun Aug 22, 2010 1:57 am
Ok sure...
Sample input data...
HEADER 11110003222200023333 000030.00
1111
1111
1111
1114
2222
2222
2224
3333 000010.00
3333 000010.00
3333 000010.00
4444
Field to be validated to be valid numeric data is in position 29,19 of HEADER record i.e. 000030.00.
Data type: -9(6)V99
Input layout position : 29,19
1) Valid (+)maximum value:
b999999.99 (blank would represent + )
2) Valid (-)maximum value:
-999999.99
3)Valid (+) minimun value:
b000000.00 (blank would represent + )
4)Valid (-) minimun data:
-000000.00
Taking an example of 30.00. To represent this value in HEADER record for both (+) and (-) values, Input HEADER record should
have below layout which can be considered as valid.
+value
b000030.00 (b - blank)
-value
-000030.00
Invalid value would be anything other then(1 thru 4) declarations that is listed above.
For ex:
Taking the example of 30.00. If input data has below or any other layout other than (1 thru 4), should be considered has invalid data.
bA00030.00 or *000030.00 or aaaaaaa.aa or b000a30.00
Sample input data...
HEADER 11110003222200023333 000030.00
1111
1111
1111
1114
2222
2222
2224
3333 000010.00
3333 000010.00
3333 000010.00
4444
Field to be validated to be valid numeric data is in position 29,19 of HEADER record i.e. 000030.00.
Data type: -9(6)V99
Input layout position : 29,19
1) Valid (+)maximum value:
b999999.99 (blank would represent + )
2) Valid (-)maximum value:
-999999.99
3)Valid (+) minimun value:
b000000.00 (blank would represent + )
4)Valid (-) minimun data:
-000000.00
Taking an example of 30.00. To represent this value in HEADER record for both (+) and (-) values, Input HEADER record should
have below layout which can be considered as valid.
+value
b000030.00 (b - blank)
-value
-000030.00
Invalid value would be anything other then(1 thru 4) declarations that is listed above.
For ex:
Taking the example of 30.00. If input data has below or any other layout other than (1 thru 4), should be considered has invalid data.
bA00030.00 or *000030.00 or aaaaaaa.aa or b000a30.00
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Given the data looks like you say, you could check for an invalid value as follows:
Byte 1 (29?) is not blank or '-' or
Bytes 2-7 are not FS/NUM or
Byte 8 is not '.' or
Bytes 9-10 are not FS/NUM.
I don't know what you mean by 29,19 given that the values are 10 bytes.
Byte 1 (29?) is not blank or '-' or
Bytes 2-7 are not FS/NUM or
Byte 8 is not '.' or
Bytes 9-10 are not FS/NUM.
I don't know what you mean by 29,19 given that the values are 10 bytes.
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
Basically here, if you see in the output file, I need a HEADER record with Key data 1111 & 2222 and the number of times it occured in the input file.
And for the Key data 3333, since it holds amount, I need the total amount for this Key.
I am unable to achieve this using ICETOOL. Could you please help.
And for the Key data 3333, since it holds amount, I need the total amount for this Key.
I am unable to achieve this using ICETOOL. Could you please help.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
It feels like we're on a Merry-Go-Round and have come full circle.
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
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page