Page 2 of 2

Re: GETTING SOC7

PostPosted: Wed Feb 15, 2012 6:19 pm
by Robert Sample
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.

Re: GETTING SOC7

PostPosted: Wed Feb 15, 2012 7:08 pm
by utpalpal07
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?

Re: GETTING SOC7

PostPosted: Wed Feb 15, 2012 7:23 pm
by BillyBoyo
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.

Re: GETTING SOC7

PostPosted: Thu Feb 16, 2012 10:23 am
by utpalpal07
thanks billy