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 Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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