IBM Support

How to compile an RPG module or program with PCML included in the object

General Page

You are in: RPG Cafe > Compile with embedded PCML

Short URL: https://ibm.biz/rpgcafe_compile_with_pcml

RPG Cafe: Compile with embedded PCML

How to compile an RPG module or program with PCML included in the object

To get PCML embedded in your module or program, add the following keyword to your H spec:

PGMINFO(*PCML : *MODULE)

If you are on 7.1 or later, and have the required PTFs described in this RPG Cafe wiki page, https://ibm.biz/rpgCafe_PCML_enhancements, you can get "nicer" PCML, with mixed-case names, by coding

PGMINFO(*PCML : *MODULE : *DCLCASE)

What is PCML?

"PCML" stands for "Program Call Markup Language". It describes the parameters of a program or the exported procedures of a module that is part of a service program. The RPG compiler can generate the PCML into a stream file or into the program or module (or both). When the PCML is generated into a module, the PCML becomes part of the program or service program that the module is part of. If you want to see what the PCML looks like, try compiling your RPG module with command parameters PGMINFO(*PCML) and INFOSTMF(mymodule.pcml). Then, look at the IFS file mymodule.pcml. If you want to see how it looks with the names in the same mixed case you used in your source, also add the PGMINFO(*PCML:*DCLCASE) keyword to your H spec.

If you want to see the PCML that is embedded in your program or service program, you can use the QBNRPII API. Here is a page with the source for an RPG program to do that: https://ibm.biz/see_pcml_embedded_in_pgm_or_srvpgm.

What is PCML for? How is it used?

If you're wondering why you'd the PCML embedded in your program or service-program module, Integrated Web Services (IWS) can use the PCML embedded in a program or service program to generate a web service from your program or a procedure in your service program. For example, here's the first in a series of articles about how to build a REST service that uses IWS: https://www.ibm.com/developerworks/ibmi/library/i-rest-web-services-server1/

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"Component":"ILE RPG Compiler","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
16 December 2019

UID

ibm11118445