View previous topic :: View next topic
|
Author |
Message |
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
I am encountering soc7 can you please help me to solve this.
I am not sure if this is a data problem or I am not handling the comp-3 properly.
error-> CEE3207S The system detected a data exception (System Completion Code=0C7).
Details->
I am having an input file of fixed length (declared as X(1020) ) and
in that I have 4 comp-3 variables starting at location 68 to a length of 28( 7 Bytes each).
Declaration of each comp-3 is PIC S9(10)V9(2) COMP-3.
so it like this
var1 PIC S9(10)V9(2) COMP-3. 68-74
var2 PIC S9(10)V9(2) COMP-3. 75-81
var3 PIC S9(10)V9(2) COMP-3. 82-88
var4 PIC S9(10)V9(2) COMP-3. 89-95
i am having three input records as below. This is the taken using HEX ON.
input-> record 1,2 and 3 from position 68 to length of 28 are as below
Code: |
1->
áí< -%
0000454000026600000000000000
000755C000240C000000C000000C
2->
æ
0000339000000000000000000000
000058C000000C000000C000000C
3->
la< àÇ
0000984000046000000000000000
000431C000448C000000C000000C |
Purpose of the program->
I need to get total sum of var1, var2, var3 and var4 respectively
for all the input records above.
program.
working-storage.
01 WS-var-TOT.
05 WS-var1 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var2 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var3 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var4 PIC S9(10)V9(2) COMP-3 value zeroes.
01 WS-var-TOTALS.
05 WS-var5 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var6 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var7 PIC S9(10)V9(2) COMP-3 value zeroes.
05 WS-var8 PIC S9(10)V9(2) COMP-3 value zeroes.
procedure division.
move zeroes
to WS-var-TOT
loop starts ( read file until eof)
Read file.
move file-record(68:28) to ws-var-totals.
move zeroes
to ws-var-totals
add ws-var1 to ws-var5 ( getting Soc 7 here by looking at hex loc)
add ws-var2 to ws-var6
add ws-var3 to ws-var7
add ws-var4 to ws-var8
loop-end
I am also attaching the input records as attachment. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Try changing the "MOVE ZEROS" statements to INITIALIZE.
I believe your moves are "walking" on the comp-3 fields.
Also, it is a good idea to define comp-3 fields with an odd number of digits. |
|
Back to top |
|
|
mvenkatesha
New User
Joined: 18 Oct 2006 Posts: 23 Location: bangalore
|
|
|
|
scherrer
It worked fine thanks a lot for your help. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome |
|
Back to top |
|
|
|