IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SOC 7 with comp-3 field after reading from file.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Wed Oct 17, 2007 10:55 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 17, 2007 11:48 pm
Reply with quote

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
View user's profile Send private message
mvenkatesha

New User


Joined: 18 Oct 2006
Posts: 23
Location: bangalore

PostPosted: Thu Oct 18, 2007 12:29 am
Reply with quote

scherrer

It worked fine thanks a lot for your help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 18, 2007 5:27 am
Reply with quote

You're welcome icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top