If you need help with any of the techniques described below, feel free to contact our support team.

What are CoolSpools Spool Admin substitution variables, how and where can I use them and how to they differ from CoolSpools Spool Converter variables?

CoolSpools Spool Admin Substitution variables

When you define a CoolSpools Spool Admin standard option or user-defined option, or when you specify a command string as part of the definition of a spooled file script entry or spooled file rule, you can include CoolSpools Spool Admin substitution variables. These are very similar to the substitution variables recognized by PDM user-defined options.

The substitution variable acts as marker in the command string. At run time, CoolSpools Spool Admin will replace the substitution variable marker with a corresponding piece of data, typically an attribute of the spooled file being processed, the job in which the spooled file was created, or the user profile associated with it.

Please note, however, that, due to restrictions imposed by the OS/400 (IBM i) command processor, when you specify a command string on the CMD parameter of the RUNSPLFCMD, WRKSPLFCMD, CRTSPLRUL, ADDSPLSCPE commands and other similar commands, only certain parameters will accept the use of substitution variables, typically those that allow free-format text values. You cannot use substitution variables to supply the name of the spooled file to be processed on the FROMFILE parameter of CVTSPLPDF or the NAME parameter of DLTSPLF, for example, when those commands are specified on the CMD parameter. You must use a standard option or user-defined option instead, or, in the case of CoolSpools Spool Converter, you can use the special values FROMFILE(*SLT), JOB(*SLT) and SPLNBR(*SLT) to identify that the command should be applied o the currently selected spooled file.

The following substitution variables are recognized by CoolSpools Spool Admin and are converted at run time as shown below.

For example, you could define an option PD to run CoolSpools CVTSPLPDF command to convert spooled files to PDF format with a particular set of parameters:

PD = CVTSPLPDF FROMFILE(&F)
                    TOSTMF(&F_&D_&T.&X)
                    JOB(&N/&U/&J)
                    SPLNBR(&S)
                    STMFOPT(*REPLACE)

When this option is selected against a spooled file, CoolSpools Spool Admin will replace the substitution variables as per the table below. The TOSTMF parameter specifies that the stream file that is created should be the spooled file name followed by an underscore, then the creation date of the spooled file, another underscore, then the creation time of the spooled file, a period and the extension appropriate for PDF (PDF).

Substitution Variable At run time, CoolSpools Spool Admin replaces the variable with…
&A The user data attribute of the spooled file
&B Number of copies attribute of the spooled file
&C Product library of the command. For example, &C/CVTSPLPDF converts to COOLSPV6R1/CVTSPLPDF.
&D The date the spooled file was created. The format of this date is determined by the date format attribute of the job running the command.
&E The email address of the user that created the spooled file, as derived from the system distribution directory
&F The name of the spooled file.
&G Form type of the spooled file
&H (Currently unused)
&I (Currently unused)
&J The name of the job that created the spooled file
&K The message key of the current spooled file message (if the spooled file is waiting for a message to be replied to)
&L (Currently unused)
&M The name of the user who created the spooled file, as derived from the system distribution directory.
&N The job number of the job that created the spooled file
&O The user profile which owns the spooled file.
&P The printer device to which the spooled file is allocated.
&Q The output queue where the spooled file is currently located.
&R The output queue library.
&S The spooled file number
&T The time the spooled file was created in *HMS format (HHMMSS).
&U The user of the job that created the spooled file
&V The message queue associated with the writer to which the spooled file is currently allocated.
&W The library of the message queue associated with the writer to which the spooled file is currently allocated.
&X The file extension appropriate to the file format selected, e.g. PDF for TOFMT(*PDF), XLS for TOFMT(*XLS), TXT for TOFMT(*TEXT) etc.
&Y Date spooled file was opened in YYYYMMDD format
&Z User-defined data of the spooled file