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
 

 

Working storage variable Declaration getting SOC7

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Sat Jun 09, 2007 11:10 am    Post subject: Working storage variable Declaration getting SOC7
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: 3158
Location: Tucson AZ

PostPosted: Sat Jun 09, 2007 1:59 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 3:15 pm    Post subject:
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    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 Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts SCRNAME not working on my mainframe? mrsidhu12 TSO/ISPF 7 Thu Sep 01, 2016 2:17 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am


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