Case1: I am just comparing two files, FILE1 and FILE2. FILE1 contains MED HRA(PD) and FILE2 contains PHM HRA(PD). If a record is present in both the files, I'm taking MED HRA from FILE1 and PHM HRA from FILE2 and then writing that record to output file.
Case2: If a record on FILE1 doesn't find a match on FILE2, I want to move "zeros" into PHM HRA. But here I want to treat the "zero" values to be populated as PD.
Case3: In the same way, If a record on FILE2 doesn't find a match on FILE1, I want to move "zeros" into MED HRA. Aagain I want to treat the "zero" values to be populated as PD.
I'm merging all these records in some other step and then converting these two PD fields (MED HRA, PHM HRA) in addition to some other field into ZD fields before sending them to the actual program.
The program will sum up MED HRA and PHM HRA on each and every record and them will move the same to some other compatiable field (TOT HRA) for some other purpose. So here i'm getting the problem.
When I displayed the values, they appear to be valid, but the program is abending with a S0C7 error. I guess some where some thing is going wrong.
I believe I have provided all the details required. Its a bit urgent. Could any body help me out in this regard.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Quote:
I believe I have provided all the details required
Not quite yet. . .
If the abend is happening in a cobol program, it will help if you post the data layout. The "copybook" posted does not appear match the sort definitions. The abending procedure code may help as well.
The problem data record also needs to be posted (in hex).
The various cases may help later, but the first thing to do is resolve the 0c7.
When you post code or data, use the "Code" tab near the top of the reply panel. This will preserve alignment and make your post more readable. To see your post as we will see it in the forum, click Preview. When you are satisfied with how your post appears, click Submit.
Thanks for looking into this. Pl find the detials as you requested below. It appears to be the problem is with "zero" values which i'm populating into MED HRA/PHM HRA in the SORT. If you could see the PHM HRA values provided below, i'm missing the sign for PHM HRA (2nd field) on the file. I could see a space for that position. However if you could help me out that would be greatful to me.
MED HRA PHM HRA TOT HRA (initially this field can contain any values)
0000000050{0000000000 0000000100{
0000000000{0000000000 0000000100}
0000005000}0000000000 0000005000}
0000005148H0000000000 0000012483J
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hi Reddy,
Please look at your previous post (the one before this reply) and notice the black background and green print (that also is aligned). This is done by using the "Code" tab i mentioned earlier.
Your "bad" data value is x'00' - not a space (x'40').
I just modified the value for PHM HRA to have '{' in the balnk position to treat the value as +ve and then tried. The program executed with out any errors.
MED HRA PHM HRA TOT HRA
0000000050{0000000000{0000000100{
0000000000{0000000000{0000000100}
0000005000}0000000000{0000005000}
For both I/P and O/P I use the same data layout. When I opebed the i/p file using the data layout, I am able to see all the values properly.
The program does sum up MED HRA and PHM HRA and populate TOT HRA and then create a HDR and TRL. But when I opened the O/P file using the same layout, I can't see the values for the same amount fields. But i'm able to see the values for the rest of the fields on the O/P file using the same layout other than these three. Also when I directly opened the file with out using the data layout I could see the values for the three fields.
Q1. How can I tell the SORT that treat the "zero" values which i'm populating into MED HRA/PHM HRA(PD) as positive (using PD format).
Q2. Whats happening to the values of MED HRA, PHM HRA and TOT HRA on the O/P file.
Pl let me knoe if you want me to provide any more details.
Yes Dick, henceforth I will follow the suggetions given by you while posting a Q.
I am sure I will not have any issues for all the matching records on FILE1 and FILE2. However the problem is with the un matching records on both the files for which i'm trying to populate "zero" values.
How can I take care of this "bad" data value x'00'. This is happening for all the un matching records on both FILE1 nad FILE2. For whatever the record i'm trying to populate "zeros" into MED/PHM HRA, I am getting into a prob.
Could you pl let me know if there is a way to get rid of this bad data prob.
In Step1, the code hilighted in BOLD will explicitly move "zeros" into PHM HRA (DECIMAL (11,2)) on the first OUTFIL. The second OUTFIL will explicitly move "zeros" into MED HRA (DECIMAL (11,2)) for all the un mnmatching records on FILE2. Both MED HRA and PHRM are PD fields.
I just want o know if there is a way to tell the SORT to treat the "zero" values as PD(DECIMAL (11,2)) .
In Step2, the code hilighted in BOLD will convert PD fields to ZD(S9(9)V9(2)) to match to the copy book in my program.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hi Reddy,
Quote:
I just want o know if there is a way to tell the SORT to treat the "zero" values as PD(DECIMAL (11,2))
I'm sure there is a way, but i do not know the syntax. You would want to initialize a PD field with zeros.
As a workaround for a short time, you could check the value in the cobol program and if the field has the "bad" value (with the zeros and the x'00'), move zeros to it. I would not recommend doing this for a long-term production solution, but it would move you beyond the 0c7.
This logic is working fine. But I am looking out for a permanent and most reliable solution as this is going live in the next week. The no of i/p records could even be in millions. So any of the amount fields(MED/PHM HRA) should not get impacted because of this change.
I even tried with some hexa decimal values for populating zeros along with a sign, but i couldn't succeed. I tried with x'00000C', but it is causing some LRECL truncation.
If you could let me know the reliable solution, that would be really helpful to me.