Midrange News for the IBM i Community


Posted by: George Fuste
IBM i developer
Jacksonville, FL
Trouble converting a procedure to free form DCL-PR
has no ratings.
Published: 26 Sep 2014
Revised: 30 Sep 2014 - 1055 days ago
Last viewed on: 19 Aug 2017 (2747 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.

Trouble converting a procedure to free form DCL-PR Published by: George Fuste on 26 Sep 2014 view comments(5)

d CreateUALog     pr                  ExtPgm('UA2000RP')        
d                              256a   Varying                   
d                               10a   

 

How is this D-spec PR converted to free form DCL-PR?  I'm not sure how to represent the "CreateUALog" name in the new free-form spec.

Here is how it is used.

CreateUALog(prmMessage: PGNAME);   

thanks

GF                      

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

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Trouble converting a procedure to free form DCL-PR
Posted: 2 years 10 months 25 days 4 hours 8 minutes ago
Edited: Fri, 26 Sep, 2014 at 15:54:43 (1059 days ago)

I'm going to make an educated guess:

DCL-PR createUALog extpgm('US2000RP');
   someiNputValue  varchar(256);
   someOtherValue  char(10);
end-pr;

If you don't use a parameter label, you have to specify *N for it, which is really ugly. So I'd use labels and avoid Unnamed parameters.

Posted by: Viking
Premium member *
CA
Comment on: Trouble converting a procedure to free form DCL-PR
Posted: 2 years 10 months 25 days 3 hours 59 minutes ago

FYI, here are some explanations and examples of free-format syntax:

https://www.ibm.com/developerworks/ibmi/library/i-ibmi-rpg-support/

Posted by: Ringer
Premium member *
Comment on: Trouble converting a procedure to free form DCL-PR
Posted: 2 years 10 months 25 days 3 hours 50 minutes ago

VARYING was changed to VARCHAR huh? I suppose to attract and appease the younger talent. 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Trouble converting a procedure to free form DCL-PR
Posted: 2 years 10 months 24 days 10 hours 3 minutes ago
Edited: Tue, 30 Sep, 2014 at 10:39:53 (1055 days ago)

Actually, that was me. I suggested that VARCHAR was better than the initial IBM suggestion. I preferred the SQL syntax that way if you do a CREATE TABLE in RPG and declare a field in RPG the VARCHAR syntax is the same.

Posted by: GFuste
Premium member *
Jacksonville, FL
Comment on: Trouble converting a procedure to free form DCL-PR
Posted: 2 years 10 months 22 days 12 hours 39 minutes ago

Thanks to all who added the expertise.  I was trying to look for a good IBM example and couldnt find one.  The example supplied is exactly what I was looking for.  Thanks Bob.