View previous topic :: View next topic
|
Author |
Message |
shaikfayaz
New User
Joined: 26 Nov 2008 Posts: 9 Location: Hyderabad
|
|
|
|
Hi, I am writing a report from a file which is received from Client. Following are steps
1. I will read the total number of records in the input file and stores in a variable.
2. once the value is count value is ready i will compare the value which is received in the input file(sent by Client). But the problem i have is i took the FIXED BIN(63,0) total of 8 characters and from client side i am receiving it as Fixed dec(16,0)..
Code is :
IF TOT_REC_CNT = TRAILER_DATA_REC.REC_CNT THEN
PUT SKIP LIST('*******TRAILER RECORD COUNT IS MATCHED************');
where TOT_REC_CNT = FIXED BIN(63,0)
REC_CNT = Fixed Dec(16,0)
i am writing report as
BUP_REC_CNT = TRAILER_DATA_REC.REC_CNT;
where BUP_REC_CNT PIC '$$,$$$,$$$,$$$,$$9V.99+'. Please get back to me if the question is not clear.
but it is saying data exception error.. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
From our description, the problem would appear to be with the fields in BUP_REC_CNT = TRAILER_DATA_REC.REC_CNT;
The TOT_REC_CNT attributes are irrelevant - you are only using this internally to the program.
TRAILER_DATA_REC.REC_CNT will occupy 8 bytes and can contain up to 17 digits. Your PIC field should allow for this extra digit - you only have allowed for 16 digits. You also need to check that the input field is containing 8 bytes of valid packed data.
Garry. |
|
Back to top |
|
|
shaikfayaz
New User
Joined: 26 Nov 2008 Posts: 9 Location: Hyderabad
|
|
|
|
Yes.. The input data(16 digits, 8 byte) is valid one which holds the record count of the file.. for example if the input file have 7719 records the count will be displayed as
Code: |
Éæ
00000079
0000071C |
once i count the total records in the input file surely i will get the count as same 7719 i wanns show to them that both is matched file received with out any erros.. |
|
Back to top |
|
|
shaikfayaz
New User
Joined: 26 Nov 2008 Posts: 9 Location: Hyderabad
|
|
|
|
How can i compare the binary and decimal values(TOT_REC_CNT, REC_CNT) and then pass this success or failre info to another variable ?? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
It should be possible to just compare and set the other variable accordingly.
e.g.
Code: |
IF TOT_REC_CNT = TRAILER_DATA_REC.REC_CNT THEN
other_variable = 'matched'
else other_variable = 'unmatched' |
This IF instruction should not be getting data exception.
You didn't say which instruction was getting the data exception. Also, be aware that if the data exception is happening on the assignment to PIC, the PUT SKIP LIST data may be in buffer and therefore not visible in output as a result of the abend.
If still having problems, please post more of your code , using the 'code' tags.
Garry. |
|
Back to top |
|
|
|