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
 
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 sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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