Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: SOC 7 with comp-3 field after reading from file.
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

Site Director


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

PostPosted: Wed Oct 17, 2007 11:48 pm    Post subject:
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    Post subject: Reply to: SOC 7 with comp-3 field after reading from file.
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

Site Director


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

PostPosted: Thu Oct 18, 2007 5:27 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us