Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us