Midrange News for the IBM i Community

Posted by: George Fuste
IBM i developer
Jacksonville, FL
Using the Qp0zLprintf external procedure
has no ratings.
Published: 12 Jan 2016
Revised: 12 Jan 2016 - 2199 days ago
Last viewed on: 19 Jan 2022 (4292 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Using the Qp0zLprintf external procedure Published by: George Fuste on 12 Jan 2016 view comments(2)

In RPG free I define and call the Qp0zLprintf proc like this to write messages to the joblog:

Dcl-PR WrtJobLog Int(10:0)     ExtProc('Qp0zLprintf');   
 szOutputStg     Pointer Value Options(*String);         
 *n              Pointer Value Options(*String: *NoPass);
 *n              Pointer Value Options(*String: *NoPass);


WrtJoblog(%trimR(Message) + LF);     

"Message" is VarChar(256)

"LF" is a constant of x'25'


How would I do this same definition and call in CLLE?                                              

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: Using the Qp0zLprintf external procedure
Posted: 6 years 8 days 2 hours 18 minutes ago

You pass the LF and a null terminator since CL doesn't have *STRING as a parm option.

TESTJOBLOG: PGM                                                     
            DCL        VAR(&LF) TYPE(*CHAR) LEN(2) VALUE(X'2500')   
            DCL        VAR(&MSG) TYPE(*CHAR) LEN(256)               
            CHGVAR     VAR(&MSG) VALUE('Hello World' *TCAT &LF)     
            CALLPRC    PRC('Qp0zLprintf') PARM((&MSG))              
ENDPGM:     ENDPGM                                                  
Posted by: GFuste
Premium member *
Jacksonville, FL
Comment on: Using the Qp0zLprintf external procedure
Posted: 6 years 8 days 2 hours 15 minutes ago


I had my &LF variable as this:  DCL        VAR(&LF)      TYPE(*CHAR) LEN(1)   VALUE(x'25') 


I guess I was missing the NULL ind.