Hi,
I need to edit the price in the input dataset based on product code and payment type
Product code - starting position 30 and length is 5 (Ex: 00003)
Payment type - starting position 49 and length is 3 (Ex: ADD)
Price - Starting position 43 - S9(9)V99 COMP-3
Input dataset:
Code:
----+----1----+----2----+----3----+----4----+----5-
001000000000000000123456789AB0000220131107 ADD
001000000000000000123456789AB0000220131107 ADD
001000000000000000123456789AB0000320131107 ADD
001000000000000000123456789AB0000320131107 ADD
001000000000000000123456789AB0000320131107 NEW
001000000000000000123456789AB0000320131107 & NEW
001000000000000000123456789AB0000320131105 %NEW
Req:
1. If product code is not '00003' then copy the all the fields to output dataset with payment as blank
2. If product code is '00003'
- If Payment type is NEW then copy all the fields to output dataset with payment as blank
- If Payment type is ADD then copy all the fields to output dataset with price as ZERO and payment type as blank
The issue here is, I am getting '00000{' instead of COMP-3 data. I want to mention ZERO price in COMP-3 format. Can you please let me know what exactly I need to mention in the OVERLAY field?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You are getting zero in packed-decimal. the curly brace is telling you that it is a positive zero at that digit. The other curly brace would tell you it is a negative zero at the same position. A-I will be positive 1-9 and J-R negative 1-9.
Hi Bill,
But when I give o/p dataset as input to my COBOL program, it is getting failed with SOC 7 error. Below is the declaration for price filed in COBOL program
Code:
10 TR00-CSTAMT PICTURE S9(9)V99 COMPUTATIONAL-3
What's the issue with the data in the output dataset? Please clarify
When 30,5 is equal to C'00003' you set 30: to C'00003', which is the value you know it already has.
What you seem to by trying to do is to set a field to zero if C'00003' and ADD. You can do that in on IFTHEN=(WHEN=(logical-expression. Put the zero and blat the ADD in the OVERLAY. Then have an IFTHEN=(WHEN=NONE to blat the field which sometimes contains ADD to space for all the other records.