Troubleshooting
Problem
Message CPD0074 is thrown on STRPCCMD when the command text in the PCCMD parameter exceeds the 123 character limit.
Resolving The Problem
Message CPD0074 is thrown on STRPCCMD when the command text in the PC command (PCCMD) parameter exceeds the 123 character limit.
The 123 character limit for the PCCMD parameter is a hard limit for STRPCCMD at IBM i OS r7.1 and older and the IBM i Access for Windows PC5250 or other IBM 5250 emulators
Therefore, there are two options to alleviate this:
Option #1:
Upgrade to IBM i OS r7.2 or newer. Starting at IBM i OS r7.2 and IBM i Access Client Solutions 5250 emulator the STRPCCMD limit was increased to 1023, this is documented in the IBM i OS r7.2 Memo to users:
- 3.4.6 STRPCCMD command changes
Start PC Command (STRPCCMD) behavior changes.
When STRPCCMD is used with the 5250 emulator in IBM i Access Client Solutions, the maximum command length that may be specified for the PCCMD parameter is now 1023 characters. Other 5250 emulators may truncate the command to their maximum supported length. For example, the 5250 emulator in IBM i Access for Windows and Personal Communications will truncate the command to the existing limit of 123 characters.
Option #2:
If you are not able to upgrade to IBM i OS r7.2 or newer, then you may work around this limitation by breaking the STRPCCMD down into parts, append the parts into a batch script, and call the batch script.
The following is an example of opening a browser and passing in a long URL:
STRPCCMD PCCMD('del c:\temp\url.bat')
STRPCCMD PCCMD('cmd /c echo set first=http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/cl/strpccmd.htm?lang=en > c:\temp\url.bat')
STRPCCMD PCCMD('cmd /c echo set last=resultof=%22%73%74%72%70%63%63%6d%64%22%20 >> c:\temp\url.bat')
STRPCCMD PCCMD('cmd /c echo "C:\Program Files\Mozilla Firefox\firefox.exe" %first%%last% >> c:\temp\url.bat')
STRPCCMD PCCMD('start c:\temp\url.bat')
Historical Number
450959861
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1014367