× 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.




I am once again missing the boat... This procedure works in rpg, but not cl... The procedure AUTOF is contained in my service program, binding directory... I think it's the way something is defined in the prototype? Any ideas?

There's a difference in the way that CL programs treat one byte return values versus the way RPG does.


For some reason, a CL program thinks of a 1 byte return value as a binary numeric value, whereas RPG thinks of it as a character string. There's some routine under the covers where a pointer is used to represent a character field, but not a numeric field. That's what causes the "pointer not set" error.

You can solve the problem in two ways:

a) You can use EXTPROC(*CL) on your prototype. This will require that all of the RPG programs that call your subprocedure be recompiled to use the new prototype -- but it will tell RPG to treat 1 byte return values the same way that CL does.

        D AUTOF           PI             1A  EXTPROC(*CL: 'AUTOF')
        D InUsrId                       10A
        D InApp                          2A


b) The other alternative is to define the return value in the CL CALLPRC statement as a TYPE(*CHAR) LEN(2) field. In that case, CL will treat it as a character field and not conflict with RPG. You can simply use %SST() in your CL code to only look at the first byte of the 2 character field -- since that's all the RPG will modify.


Since this does not require any changes to the RPG prototype or procedure interface, you will not have to recompile any existing programs.

              DCL        VAR(&AUTH) TYPE(*CHAR) LEN(2) /* Use LEN=2 */
              CALLPRC    PRC(AUTOF) PARM(&USER &APPL) RTNVAL(&AUTH)

              IF (%SST(&AUTH 1 1) *EQ 'Y') DO
                  /* hooray! */
              ENDDO

Good Luck


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.