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

Working storage variable Declaration getting SOC7


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

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Sat Jun 09, 2007 11:10 am
Reply with quote

Hi,

COPYBOOK Variable
ACCOUNT_DET is decalred as PIC X(14). For this variable the Input File contains values -110.25,+220.44,-199.88 and so on...

I want to read this file and do the sum of all the values. Please help me out for this.

I am getting SOC7 for this. The statement which is in bold is giving SOC7 Error. I am in confusion of how to decalre this type of varibale and how to resolve this type of problem.

I have decalred a Working storage variable Y PIC S9(12)V99.

and Z PIC S9(12)V99.
MOVE ACCOUNT_DET TO Y.
COMPUTE Z=Z+Y


Thanks in Advance
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Jun 09, 2007 1:59 pm
Reply with quote

Try: COMPUTE Z = Z + FUNCTION NUMVAL(ACCOUNT_DET).
Back to top
View user's profile Send private message
munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Mon Jun 11, 2007 3:02 pm
Reply with quote

You can also use redefine for ACCOUNT_DET. I mean, you redefine ACCOUNT_DET and use that redefined item to move into Y.

Because, you are getting S0C7 on MOVE statement, the above FUCTION NUMVAL will not work for you. The control will not come to this statement at all.

Regards
Munikumar G
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 3:15 pm
Reply with quote

munikumar wrote:
You can also use redefine for ACCOUNT_DET. I mean, you redefine ACCOUNT_DET and use that redefined item to move into Y.
Redefine will fail, it is the embedded decimal point and sigh that are causing the S0C7.
Quote:
Because, you are getting S0C7 on MOVE statement, the above FUCTION NUMVAL will not work for you. The control will not come to this statement at all.
Wrong, numval is the only (simple) answer.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts CICS vs LE: STORAGE option CICS 0
Search our Forums:

Back to Top