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?).
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.
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.