IBM Support

CL Example Using the STRPCCMD Command

Troubleshooting


Problem

The following is a CL example that uses the STRPCCMD command.

Resolving The Problem

Caution: The following code is only an example. IBM accepts no responsibility for its correctness.


If the Start PC Command (STRPCCMD) uses a URL with a special character (like the & sign) or if it is case-sensitive, you must put the value of the URL in single quotation marks and then in double quotation marks. The IBM i CL command syntax checker requires only the single quotation marks. But because the command is sent to DOS and then DOS sends the command to the browser, the double quotation mark is needed so DOS does not truncate the URL. You get message CPD0744 if the value is over 123 characters.

Note: This CL program needs to be run in an interactive session, not as a batch job.

The following is a CL example using STRPCCMD:
PGM
       DCL        VAR(&URL) TYPE(*CHAR) LEN(123) +
                    VALUE('"HTTP://WWW.IBM.COM"')
       DCL        VAR(&STRCMD) TYPE(*CHAR) LEN(123)
       STRPCO     PCTA(*NO)
       MONMSG     MSGID(IWS4010)

       CHGVAR    VAR(&STRCMD) VALUE('START IEXPLORE.EXE' |> &URL)
       DMPCLPGM
       STRPCCMD   PCCMD(&STRCMD) PAUSE(*NO)
 ENDPGM:     ENDPGM


When this program is invoked it will open up a browser session and go to the URL you have specified.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m3p0000006x8GAAQ","label":"CL"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Historical Number

459625238

Document Information

Modified date:
19 September 2022

UID

nas8N1014202