Error 954 has occurred in natural program

You might post the Natural program source for forum members to review, along with the batch job’s output.

What version of Natural (and fixes) are you on?

But your best bet is probably to open a support request with Software AG to get assistance. The S0C1 is likely either an issue with the file (you didn’t indicate if the error appears to be on the first write or after many writes) or perhaps an issue with Natural (you are up to date with your Natural fixes, aren’t you?).

It is not on the First write. The output has got many writes before the actual error. We are on Natural 8.2.5 and are up to date on fixes.

Do you use Natural Optimizer Compiler? I recall that the lineno may not be correct in this case.

Could you post the WRITE statement and five statements around it? Also, please include formats for all variables that appear in the statements.

Hi All,

We are getting the 0954 error when trying to assign p5.2 value to p8.2 field value. Below is the code sample.

WHEN #PMP305A.EUR-STANDARD-COST = 0
#PMP305A.EUR-STANDARD-COST := #PMP265A.EUR-STANDARD-COST

#PMP305A.EUR-STANDARD-COST is p8.2
#PMP265A.EUR-STANDARD-COST is p5.2

Wrote adhoc program to check the values from file and it works fine without any error.

DEFINE DATA
LOCAL
01 PARTS-MASTER VIEW OF PARTS-MASTER
02 PART-NO
02 STD-COST
*
01 #STC (A8 )
01 #PACK (P8.2)
*
END-DEFINE
*
FIND PARTS-MASTER WITH PART-NO = ‘14464BV80A’
*
WRITE ‘STD-COST:’ STD-COST
WRITE ‘HEX:’ STD-COST (EM=HHHHHHHH)
MOVE STD-COST TO #STC
WRITE ‘#STC:#STC
#PACK := STD-COST
WRITE ‘#PACK:#PACK
*
END-FIND
*
END

Results :

Page 1 17-03-20 07:57:15

STD-COST: 4.95
HEX: 0000495F
#STC: 495
#PACK: 4.95

Need your valuable suggestion to fix this issue as it is causing problems in production.

Could you show us the statements that are just before the WRITE statement (or are they the WHEN followed by the ASSIGN?) and just after the WRITE statement?

I would place a WRITE statement just before the WRITE statement that is causing the problem. Your adhoc program probably does not duplicate the actual code from the production program. I am guessing that something happened to #PMP305A or #PMP265A between the file read and the code that is causing the problem.

Hi Steve,

Below is the actual code in the program. We are getting 954 error in the assign statement.

WHEN #PMP305A.EUR-STANDARD-COST = 0
#PMP305A.EUR-STANDARD-COST := #PMP265A.EUR-STANDARD-COST

Adhoc program is to check whether the value from file is ok. STD-COST value is being moved to #PMP265A.EUR-STANDARD-COST and this field is used in the assign statement.

We are assuming from result of adhoc program, there is nothing wrong with the data. We are not sure how 954 is getting populated.

How are those variables initialized? Since you do not seem to be moving values from the database record but from a user variable, I am wondering if the whole variable #PMP265A contains spaces so when you evaluate #PMP265A.EUR-STANDARD-COST, it is not numeric but x’40404040…’.

What Steve suggests in displaying the value of #PMP265A.EUR-STANDARD-COST would be best. If the display of the variable’s content in packed numeric format itself errors out, you will need to interrogate the content from the perspective of an alphanumeric user variable in hex mode.

What I was asking is for more information about the actual code.

If I am interpreting what you have said correctly, it seems you have a READ statement followed immediately by
WHEN #PMP305A.EUR-STANDARD-COST = 0
#PMP305A.EUR-STANDARD-COST := #PMP265A.EUR-STANDARD-COST

Is this what the code actually looks like?

If not, could we see all the code between the READ and the WRITE that is causing the error.