× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Robert,

[SNIP]
> PASTMONTH = %char(atoi(%subst(MONTHID:1:4))-1) + %subst(MONTHID:5:2)
[SNIP]
> RNF0955  Item is not valid as the left-hand side of an EVAL operation.

I have to say that I'm a bit frustrated at this thread.  You've got people
blaming the problem on atoi(), you've got people blaming the problem on
%char(), or saying that the expression needs to all be in %char(), or that
the file might not be open... and all of these things are COMPLETELY
IRRELEVANT to the error message.

The error is that it can't assign something to PASTMONTH.  Something in
the definition of PASTMONTH is making appear as something that can't be
modified.  Either its a CONST parameter, or in some other way, it's
something that you're not allowed to change.

For my own sanity, I tried the following program.  It works perfectly, no
errors during compile or runtime, and it achieves the results that you're
looking for:

     H DFTACTGRP(*NO) BNDDIR('QC2LE')

     D atoi            pr            10I 0 extproc('atoi')
     D  charValue                      *   value options(*string)

     D MONTHID         S              6A   inz('200404')
     D PASTMONTH       S              6A

      /free

       PASTMONTH = %char(atoi(%subst(MONTHID:1:4))-1) + %subst(MONTHID:5:2);
       *inlr = *on;

      /end-free


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.