wow – that has got to be the longest url yet   😉

 

QSPGETF AND QSPPUTF APIs AND COMMANDS

IBM Knowledgebase item 8011926 describes two APIs that are undocumented in the AS/400 manuals. The two APIs, Get Spooled File (QSPGETF) and Put Spooled File (QSPPUTF), copy spool files to and restore them from physical files, respectively. The advantage of QSPGETF and QSPPUTF over the well-documented Copy Spooled File command (CPYSPLF) is that the APIs are able to copy Advanced Function Printing Data Stream (AFPDS) and Intelligent Printer Data Stream (IPDS) spool files, whereas CPYSPLF cannot.

You can call the QSPGETF and QSPPUTF APIs directly, or you can call them using command wrappers over the APIs.

  • Calling the APIs Directly

The QSPGETF API call below saves spool file QPRINT to database file SPOOLDB in USER1LIB library, member MBR1, where the spool file number is 1 and the spool file job is 010160/user1/dsp03:

CALL PGM(QSYS/QSPGETF) PARM(‘QPRINT ‘ ‘SPOOLDB USER1LIB ‘ ‘DSP03 USER1 010160′ X’0001’ ‘MBR1 ‘)

...
Read More

Get Sysname using SQL The IBM i System Name is not the same thing as the SQL Local DB Server name, although it may be the same by default. You can retrieve the SQL Local DB Server name using this SQLRPGLE code snippet: exec sql values current server into :systemName; If systemName = ‘my-ibm-i-system-name’; do

Read More

For any RPG programmer, writing RPGLE code (sometimes called RPG4) is fun. But, upgrading older RPG programs to the latest free form program layout is even more fun! The joy experienced when the Project is to “Modernize RPG” always puts an inane grin on my face. So lets look at a simple example: Get Sysname

Read More