GETTING SOC7



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: GETTING SOC7

Postby Robert Sample » Wed Feb 15, 2012 6:19 pm

Problem 1: you cannot have periods in the input data. If you have periods as you do, you must have a period in the PICTURE to match.

Problem 2: COBOL does not handle variably positioned data well. It is not possible to tell, since you didn't use the Code tag, if your input data is fixed position or not. If not, you need to make it fixed position before proceeding. Those positions must match your record layout in your program.

Problem 3: You do not initialize your table elements. Hence, you have no way of knowing what the starting values are. Your initialization code needs to loop through the table, setting your table variables to initial values. This is especially important since you don't bother counting the number of input records to know how many table elements are used. Which means unless you have exactly five input records every time, you will be dealing with uninitialized data for every table record that did not have data read into it.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Re: GETTING SOC7

 

Re: GETTING SOC7

Postby utpalpal07 » Wed Feb 15, 2012 7:08 pm

hi robert,

thanks it helped me and i changed the i/p and initialization in table also.

But after

why the addition of
s-amt1 & tbl-salary is giving SOC7?
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Re: GETTING SOC7

Postby BillyBoyo » Wed Feb 15, 2012 7:23 pm

Either s-amt1 or the tbl-salary in question is not valid for the addition. Much more it is difficult to say, as that is all you have said.

If you are happy that s-amt1 contains valid numeric-only data (you can use a NUMERIC test as an exercise in your program) then either tbl-salary is not initialised, or it is not initialised correctly, or the index/subscript you are using to access it is not within the bounds of the table. Check if you are using compiler option SSRANGE, which will give you an abend if you try to access storage outside of the table being used at the time.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: GETTING SOC7

Postby utpalpal07 » Thu Feb 16, 2012 10:23 am

thanks billy
utpalpal07
 
Posts: 43
Joined: Wed Feb 08, 2012 12:02 pm
Has thanked: 1 time
Been thanked: 0 time

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post