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 - 683 days ago
Last viewed on: 24 Nov 2017 (1710 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);
End-PR;   

 

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

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Using the Qp0zLprintf external procedure
Posted: 1 years 10 months 13 days 15 hours 17 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: 1 years 10 months 13 days 15 hours 14 minutes ago

Thanks!

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.