Contact Us


COZZI AppTools Revision History


  • IBM i v7.1 and later.

Change Log

This is a list of what has been added to or updated in Cozzi APPTOOLS with the most current build. Use our DSPVER command to determine the current build installed on your system.

Version 4.1 Build 16124

This release marks the first build to require IBM i v7.1 and later. It no longer runs on prior releases.

The major change for existing customers (and new ones) is that the CPYTOCSV and CPYTOXML commands have been retired and are no longer included. We made this decision for two reasons: (1) Our new SQL iQuery product supports a much more powerful output to CSV/Excel/XML option and (2) IBM has optimized the CPYTOIMPF command that is included with IBM i, such that it uses a similar interface to what we used in CPYTOCSV. Therefore CPYTOIMPF no longer performs poorly. But again, for Users who wish to use an SQL interface to output CSV, XML, Excel, or PDF, you should look into our SQL iQuery product.


Version 3.0 Build 15069

The SENDOBJ and SENDLIB commands have been enhanced. Previously SENDLIB used a value of UPDHST(*NO) and SENDOBJ used UPDHST(*YES). Both commands now included the UPDHST parameter, with the initial/default setting set to UPDHST(*NO). Users requested that UPDHST(*NO) be the default since sending libraries and objects to other systems should not update the save history information in the object's OIR.

The RTVDATE command has been updated to support better MonthEnd and MonthStr (EOM and BOM) values. There have been other miscellaneous enhancements as well.

New Function: EDITDATE

The new editDate function allows RPG users to convert a true Date variable into an edited text value. The first parameter must be a true Date variable ("D" datatype in RPG IV); the second parameter is the format for the returned date text value. The textual date is returned in the locale language. Any date format pattern is supported, plus addition reserved formats. For example:

D ordDte         S                 D
D prtDate        S               20A
      prtDate = editDate( orddte : 'DD Mmm YYYY');

If the value in ORDDTE is March 3, 2015, the above function would return the date as '3 Mar 2015'.

Another use is for accounting report where only the Month and Year are desired. The example below illustrates several variations of the accounting format that can be returned:

D ordDte         S                 D
D prtDate        S               20A
      prtDate = editDate( orddte : 'Mmm YYYY'); // e.g., Mar 2015
      prtDate = editDate( orddte : 'Mmm YY'); // e.g., Mar 15
      prtDate = editDate( orddte : 'MmmYYYY'); // e.g., Mar2015
      prtDate = editDate( orddte : 'MmmYY'); // e.g., Mar15
      prtDate = editDate( orddte : 'Mmmmmmmmmz YYYY'); // e.g., Mar 2015
      prtDate = editDate( orddte : 'Mmmmmmmmmz YY'); // e.g., March 15

Any date pattern is supported. In addition, several pre-defined pattern format are included. Some of these are identical to those available using %CHAR( myDate : fmt ) and are included for consistency. The supported pre-defined formats include:

Returned Textual Date Format
*JOB The job's date format.
*MONTH Mmmmmmmmmz e.g., January
*TEXT Wwwwwwwwwz, Mmmmmmmmmz ZD, YYYY
e.g., 'Tuesday, March 3, 2015'
*MDYTEXT Mmmmmmmmmz ZD, YYYY
e.g., 'March 3, 2015'

Version 3.0 Build 14266

CPYSPLF and CPYOUTQ have been enhanced. When copying to *PDF format, the name of the PDF stream file now defaults to *SPLF instead of *SPLFNAME. This news default causes the resulting PDF file name to include the Job Number, SPOOL Number and SPOOL File Name. For example, 098136_000238_QPRINT.PDF This change was incorporated to avoid SPOOL files with duplicate names and numbers from overlaying each other during a CPYOUTQ command. For example, previously if two different jobs included the same SPOOL file and both had a SPOOL file number of 1, then both are written to the IFS as PDF, but the 2nd one would overlay the first one since the resulting names were identical. Today, using *SPLF for the Stream File name insures uniqueness in the generated PDF file name.

Version 3.0 Build 14229

This is an internal build to correct an issue with CPYTOCSV headers and an internal issue with global retention of the output record counter.

Version 3.0 Build 14225

The number of fields supported by the CPYTOCSV command has been increased to the system limit (8000). Previously the limit was set at the CL command limitation of 300. Now when INCFLD(*ALL) is specified using CPYTOCSV, the number of fields is no longer limited to 300.

The CPYTOCSV command was not properly applying member overrides. This caused it to always access the *FIRST member in the file. This issue has been corrected.

Version 3.0 Build 14222

The CPYTOCSV command has been updated. Previously when zero records were detected in the input file, the new SQL engine was not being shut down properly. This could cause a eventual problem if several CPYTOCSV or CPYTOXML commands were run in the same job following the zero-records issue, in some cases it would cause the conversion that had valid records to convert, to output an empty set. The while the CPYTOXML does not use the new SQL engine yet, it uses the same components as CPYTOCSV therefore it could have been impacted by this issue. The SQL engine is now properly shut down after an unsuccessful attempt to convert zero records to CSV.

Version 3.0 Build 14150

The RSTSPLF (Restore SPOOL File from Archive) command had an issue when SPLF(*SELECT) was specified along with a creation date. This issue has been corrected.

The new DSPDATE command display the current date and time along with the System Name and IBM i version number. The information is sent as a *COMPLETION message to *PRV and normally appears in the subfile message queue at the bottom of the screen or on the Command Entry display.

Version 3.0 Build 14138

This is a general maintenance release with a few bug fixes and enhancements. There is a new DSPDATE command that displays the current system date/time along with IBM i VxRyM0 version information and the system. name. This  differs from a long-time DSPSYS command in that no COZTOOLS/APPTOOLS versioning information is included (better for end-users to use) and performance is much better. It is effectively our very fast DSPVER command without the COZTOOLS/APPTOOLS-related info.

The DSPOBJINF (Display Object Information) command has been enhanced. It includes the Activation Group property for *PGM and *SRVPGM object on the listing. It is written to the report where the Object Size was. For other objects, such as *FILE objects, the object size continues to be reported.

The SENDSAVF (Send Save File using FTP) command now includes the ability to send to multiple target remote systems or partitions simultaneously. This feature was introduced in build 14072. What is new in the current build is the ability to automatically submit each SENDSAVF remote process to a batch job queue. The new JOBQ parameter, if specified, will submit each transfer to the indicated JOBQ as an individual entry. For example if you send a save file to 10 different remote systems, then 10 batch jobs are submitted to the user-specified JOBQ.  TIP: We often use JOBQ(QUSRNOMAX) to transfer everything simultaneously, but your environment may have other requirements, policies and procedures to follow. 

The SCANRPL (Source Member Scan/Replace) command has been enhanced internally. We rewrote the scan/replace component in C and C++ to provide better performance and support older releases of IBM i. The basic function of SCANRPL has not changed, you type in a Source File, Library, and a scan Pattern, along with the Replacement text and a few options and it scans all the source members in that file and replaces the text pattern with the Replacement text.

Version 3.0 Build 14096

The WRKPRT (Work with my Print SPOOL Files) command has been enhanced. The primary use for WKRPRT is to display a list of the current user's SPOOL files created during the current job or created today. By default, WRKPRT now displays a list of all the SPOOL files created "today" and the optional "WRKPRT *JOB" command displays a list of all the SPOOL files created for "this" job only. Specifying a user profile other than *CURRENT or *JOB now defaults to all SPOOL files created "today" by that user profile.

The RTVDATE (Retrieve Relative Date) command now uses the default option of *JOB instead of *CURRENT. The meaning is the same as *CURRENT which is retained for legacy purposes. Programmers who explicitly specify RTVDATE DATE(*CURRENT) should switch to DATE(*JOB) but existing code will continue to function as it always has. If your CL code uses the default setting for the DATE parameter of RTVDATE, or any other setting besides *CURRENT, no change is necessary. History and reasons for this change: The meaning of *CURRENT was ambiguous. Some users felt it should be the current system date, while others felt it should be the job run date. To set the expectations correctly, we've deprecated *CURRENT, while still supporting it, and moved to the more clear *JOB, meaning "Job Run Date". Therefore should a user change their job's job date, the default date value that the RTVDATE command returns shall continue to be the current job's run date.

The MOVSPLF (Move (last) SPOOL File) command has had performance improvements when specifying *LAST as the SPOOL File Name.

 Version 3.0 Build 14088

The new Cozzi AppTools Menu has been introduced. Type in APPTOOLS or GO APPTOOLS to bring up the menu. It may be used in place of STRPDM and provides similar retention of your defaults to the PDM menu, as well as having identical options 1, 2, and 3 compared with the STRPDM menu.  This menu is still in BETA and does not include F4 prompting for File, Object or Member names when options 1,2 or 3 are selected. This capability is planned for a future release. However the values entered for the File, library and Member names are retained between calls and saved to the user profile.

Version 3.0 Build 14072

Rebranding: The "cozTools" product has been rebranded as "Cozzi APPTOOLS" or simply "App Tools". This takes effect with version 3.0 of the product. It does not impact existing customers as their SWMA and runtime licenses are implicitly migrated to this new version. The product library continues to be cozTools in order to provide compatibility with existing applications. No software changes are necessary and recompiling is not required. Some COZxxxx messages have been updated to use the new branding term "APPTOOLS" instead of "cozTools". But all message IDs used by APPTOOLS are identical to cozTools. The new branding includes the following name changes:

  • App Tools - Runtime plus CL commands that may be used interactively or in CL programs.
  • Developer Tools - AppTools plus /COPY source to use the AppTools in RPG IV programs.
  • Enterprise Tools - AppTools, Developer Tools, plus the full source code to the product for escrow/archival purposes.

RTVOSVER - The new Retrieve IBM i Operating System Version (RTVOSVER) CL command returns the current IBM i version, release and modification to a user-supplied CL variable. This is useful when writing OS release-level dependent code.

SENDSAVF - The Send Save File via FTP (SENDSAVF) CL command has been enhanced. It now supports up to 64 remote system IPs or names with one SENDSAVF command. To use this new function, all remote systems must accept the same user ID and password. This feature was added to ease transferring save files in shops that distribute objects (save files) to multiple systems or partitions on their networks where a shared User ID and Password exist.

Version 2.5 Build 14064

CPYSRCMBR - The Copy Source Member (CPYSRCMBR) command has been enhanced and removed from Beta status. The primary use for CPYSRCMBR is to provide a conditional "Copy Source Member" command where source members are copied to the target source file only when they meet specific criteria. For example, when the member does not exist in the target source file, when the member exists but the from member is newer than the target source member. There are 3 controls that may be customized to condition whether or not a CPYSRCF statement is generated and run for the source member. The enhancements to the CPYSRCMBR command include: (1) Parameter names now match those of IBM's CPYSRCF. (2) A new CRTFILE parameter allows the user to create the target source file (a feature not provided by the CPYSRF command). The created source file is the same record length as the original FROMSRC file.  (3) A new MBROPT parameter allows the source records to be added or replaced in the target source member, and (4) A new TOMBR parameter allows you to target a specific member for the copy. The default is TOMBR(*FROMMBR). The LOG (Log CPYSRCF commands to the joblog) parameter has had its default changed from LOG(*YES) to LOG(*NO). Beta uses complained that when copying an entire source file (all members) the joblog would become to cluttered by default.

LISTS API Functions: GetNextEntry() - The GetNextEntry function that has been in cozTools and RPG xTools "Lists" functions since the beginning had a small issue reported with the function's use of a Static Pointer to User Space. Previously this pointer was stored in a STATIC variable and not reinitialized upon return--assuming the User Space still existed. However if the user space is deleted, a pointer exception could occur if the function is called again and the same user space name is specified. This problem has been corrected in this release.

Version 2.5 Build 14044

CPYPRTF - The Copy Spool Print File (CPYPRTF) command has been enhanced. The new STMFDIROPT (Stream File Folder Option) can be used when the Output Queue (OUTQ) parameter is *PDF or *TEXT. It controls whether to create the IFS directory where the Stream file is stored. It is a recursive option, so any child/sub folders are created after the higher level folders are created.  The second enhancement is the addition of the *STMF option for the STMFNAME parameter. When STMFNAME(*STMF) is specified, only the STMF parameter is used for both the IFS folder location and target file name. This option was added due to a customer request.

Two other enhancement in CPYPRTF: 

  • The HOME folder is retrieved from the User Profile object. When *HOME is specified, the home directory associated with the user profile running the command is retrieved and used as the home directory. Specifying the %h substitution value in any STMF or STMFNAME parameter string causes this new "home directory" to be embedded in the name. For example: Assume user COZZI has an IFS Home Directory of "/HOME/USERS/COZZI". When the CPYPRTF command is run with STMF(*HOME) the IFS directory where the file is stored will be "/HOME/USERS/COZZI". You may also customize and incorporate the %h symbol into a folder name. For example if STMF(%h/pdf/ibmspool') is specified and again user COZZI is running the command, it would produce '/home/users/cozzi/pdf/ibmspool' as the folder where the PDF or TEXT file is stored. Specifying STMF(*HOME) is the same as specifying STMF('%h'). Previously the command would retrieve the user profile and append it to a hard-coded '/home' as a subfolder name. Now the home folder is retrieved from the user profile itself.
  • A final message "Spooled file copy to..." is generated when a *PDF or *TEXT file is specified. This message is sent to the caller's message queue. This message should appear on Command Entry or in your joblog. Previously the system issued completion message CPC3311 (which is still generated) when the copy was performed. But that message is often logged at a lower level and is sometimes difficult to locate when running the Command interactively.

Version 2.5 Build 14036

CPYPRTF and CPYOUTQ - The Copy Spool File and Copy Output Queue commands have been enhanced. The new STMFCCSID (Stream File CCSID) parameter allows a specific CCSID to be assigned to the target IFS stream file. The default is STMFCCSID(*PCASCII) which is ccsid 819. Normally the default CCSID is "no ccsid" or ccsid(65535). This is fine since the resulting stream file is considered "binary" and is display correctly on a PC/Mac or Browser. However viewing the contents of a PDF on the IFS with ccsid(65535) can be challenging. These two cozTools CL commands now default to PC ASCII ccsid(819) for the stream file and allow it to be viewed with WRKLNK option 5 or the DSPF CL command.

Users who have embedded the CPYPRTF or CPYOUTQ commands into their own applications will see the resulting IFS stream files as ccsid(819) when this build is installed. This should not impact the content of the PDF stream files but rather gives the IBM i operating system the ability to properly display certain data contained in the PDF file itself.

Version 2.5 Build 14029

SENDSAVF - The Send Save File (SAVF) using FTP (SENDSAVF) Command has been enhanced. It now supports the ability to sort the list of SAVFs. The new default behavior is to sort the save file list by Size, Library and Object Name. The ability to specify *ARRIVAL is also provided. This capability was introduced to allow users to transfer the list of save files by size so that the smallest save files will be transferred first. But rather than simply force this change without exception, we've included the new ORDERBY parameter that defaults to this new sequence but allows the user to modify the sequence. Existing SENDSAVF commands embedded in CL programs or the Job Scheduler will automatically use the default sort sequence when this update is installed. Note that if the number of save files being transferred is 1, the ORDER BY parameter is ignored.

COZSQLLIB - Our SQL Service Program, is the engine behind the popular CPYTOCSV command. It has been enhanced to support direct output to the Web for SELECT result sets. When a requested is issued from an RPG application, cozSQLLIB can generate a set of data using the SQL SELECT statement and have that data returned to the program or written directly to the web with HTML tags wrapping the resulting data. There is a standard set of default tags in place, but the RPG programmer can modify those default tags to whatever the application design demands. [NOTE: The web component of COZSQLLIB is in beta.]  Initially the data is rendered as an HTML Table and includes the <THEAD> <TBODY> and overflow:auto attributes. This provides a scrollable dataset while retaining the positions of the table headers.

Version 2.5 Build 14022

CHGJOBA - The Change Job Attributes Using a Job Description (CHGJOBA) Command has been enhanced.

  1. JOBD(*USRPRF) may now be specified to direct the command to use the Job Description associated with the User Profile running the CHGJOBA command.
  2. When the Job Description's library list parameter is INLLIBL(*SYSVAL) the QUSRLIBL system value is retrieved and used to modify the current library list.

DSPOBJLVL - The Display Object Information (DSPOBJLVL) command has been enhanced. It now includes the Object Size as part of the listing. In addition, users may use the object size in the INCLUDE parameter to include only objects of a certain size. Sorting by Object Size is not permissible as IBM stores the object size in 2 separate locations (a size and a size multiplier) and therefore prevents sorting by the true object size.

SAVROLLING - The Save Library to a Rolling Backup (SAVROLLING) command has been enhanced. It now includes the Save While Active parameters to enable saving libraries while active. Previously the command always used SAVACT(*LIB) behind the scenes. But with this latest enhancement the user may control the save while active options. NOTE: With this update, the SAVROLLING's save while active parameter no longer defaults to *LIB. Therefore if a save while active is necessary, users need to specify SAVACT(*LIB) to achieve the same results. This makes the command consistent with other cozTools and IBM i SAVxxxx commands. Users may also use the CHGCMDDFT SAVROLLING 'SAVACT(*LIB)' command to change the command to default to the save while active state.

Version 2.5 Build 14014

DSPOBJLVL - The Display Object Level information (DSPOBJLVL) command now includes the ability to SORT the output information. The new ORDERBY parameter may be used to specify the sort sequence. The 2nd enhancement is the introduction of the OBJSTS (Object Status) parameter. This parameter allows the list to be limited to only Damaged Objects. The parameter is flexible in that you may specify that all, only damaged, only partially damaged, locked or un-authorized objects are included. You may also specify any combination of those statuses. This means the DSPOBJLVL command can now act as a Damaged Object Report for IBM i objects. For example, to generate a list of all damaged objects that appear in the PAYROLL library, the following command may be used:


This produces a list of damaged or partially objects that exist in the PAYROLL library.

DSPCRTSRC - The Display Object Creation Source (DSPCRTSRC) produces a joblog message with the name(s) of the source file member(s) that were used to create the object. If the object is an multi-module ILE program or service program, each module's creation source is listed. (Note: This command has been included in cozTools for about a year but is only now being announced.)

Version 2.5 Build 14002

CLEDIT - A few bug corrections where implemented due to a compiler change from RPG to C/C++.

Print Monitor - Bug fixes and a change to the CHGPRTMON command to support it being run when no print monitor is started.

SENDSAVF - A bug fix when the Save-while-active option is used that prevented the command from completing as excepted.


Version 2.5 Build 13355

CHKACTJOB - The Check Active Job (CHKACTJOB) command allows a CL program to search for an active job by giving it only the job name. This CL command exposes the 2-year old isJobAction() function's interface to CL programs. Use MONMSG to determine if a job that matches the name specified, is active. Various job statuses and types may be used to refine the test.

CHGJOBA - The Change Job Attributes to that of a Job Description (CHGJOBA) command allows you to store some job attributes in job description OBJTYPE(*JOBD) objects and then change a running job to some or all of those attributes. See the CL Commands page on this site for a list of the parameters available to the CHGJOBA command. For example, a *JOBD object named PAYROLL exists with a library list and Output Queue set up for Payroll environment. Issuing the following CHGJOBA command changes the library list and OutQ of the current job to that of the PAYROLL job description:


Going a step further, using the cozTools SAVE and RESTORE library list commands, we can preserve the library of the job so that user need not worry about it. For example:

SAVLIBL    /* Save the library list */
  /*  Do the payroll stuff here.  */
RSTLIBL    /* Put library list back the way it was.

Version 2.5 Build 13341

SENDOBJ, SENDSAVF, SENDLIB commands have been enhanced. In addition to minor bug fixes, they now all included a Passive FTP Mode (PASV) parameter. This allows the user to specify the PASV mode setting that is passed through to the FTPFILE command. For clients with certain networking systems, modems and other equipment that do not support Passive or Extended Passive modes, this option allows you to adjust that setting.

DSPOBJLVL - The Display Object Release Level Information (DSPOBJLVL) command had an issue when selected to filter by Target Release level. This issue is corrected in this build.

Version 2.5 Build 13336

DSPOBJLVL - The Display Object Release Level Information (DSPOBJLVL) command has been enhanced. The select/omit parameter (INCLUDE) now supports the Last Used Date. Therefore, it is possible to include objects on the list that were last changed On, After, or Before a certain date or any combination thereof. See the INCLUDE parameter for details and syntax.  Here is an example: List all the objects in the library named PRODLIB that have NOT been used since October 1, 2012:


The Date value itself may be specified in *JOB or *ISO date format; however the date may be specified in most other date formats including *USA, *EUR, *JIS, *CYMD, *MDY, *YMD, or *DMY. The command tests the date for a valid date in on of those formats. The first date format that passes the test is used for the date. It is recommended that the date value be specified as *JOB, *ISO or *CYMD date format. If date separators are ignored.

Image Conversion Library Preview (BETA) - The image conversion library preview allows you to convert images from one form to another. Currently images may be converted to JPEG format. Any popular image format can be converted to JPEG. We selected JPEG format as the target format due to the support for JPEG in the AFPRSC keyword in PRINT FILE DDS. These routines are native IBM i programs and service program objects and convert images stored on the IFS. The library is in beta so contact us should you require help integrating them into own job streams. The production release of the Imaging library routines shall be included in the next major version of COZZI TOOLS.

Version 2.5 Build 13316

ADDLIBL - The new ADDLIBL (Add Libraries to Library List) command is substantially similar to the IBM i ADDLIBLE command . However our new ADDLIBL command allows up to 250 library names to be added at one time. For example:


The ADDLIBL command supports adding up to 250 library names at a time (the current IBM i limit). It can be used to add multiple libraries or used similar to ADDLIBLE to add a single library name to the library list. This command uses the popular addlible() function found in cozTools runtime library.

Version 2.5 Build 13309

SENDLIB - The Send Libraries to another System or Partition (SENDLIB) command has been enhanced. It now includes Save While Active and RSTLIB parameters.

SENDOBJ - The Send Objects to another System or Partition (SENDOBJ) command has been enhanced. It now includes Save While Active parameters.

SENDSAVF - The Send Save Files to another System or Partition (SENDSAVF) command has had minor enhancements and bug fixes.

SQLLIB - The new getAsHTML() function allows the resulting data set, from a SELECT statement, to be returned as HTML. It also optionally allows the resulting HTML to be directly written to the web browser without returning anything to the user-program. This allows you to run the SQL SELECT statement within your RPG for the Web applications and send the output directly to the webpage.

Version 2.5 Build 13300

CPYTOCSV - The RMVBLANK (remove leading and trailing blanks) option has been added to this command. This parameter allows the user to control whether or not individual fields that contain trailing blanks shall have those blanks removed when converted to CSV format. The default is RMVBLANK(*BOTH) meaning both trailing and leading blanks are removed. The ccsid (TOCCSID) parameter has been updated to include special values for UTF-8 and UTF-16 character sets. Output to those CCSIDs was always possible, but not the inclusion of *UTF8 and *UTF16 make direct conversion easier. Please note that Microsoft Excel cannot automatically open UTF-16 files. It can import them using the File | Import menu option, but will not auto-open and auto-convert it to Excel format as it does with PC ASCII and UTF-8.

Other miscellaneous fixes and improvements.

Version 2.5 Build 13298

The CSV engine has been enhanced. When using the csvOpen, csvWrite, csvClose interfaces, they no longer require the use of the csvSetOption() function to setup string delimiters. The CPYTOCSV command has a STRDLM parameter which defaults to *QUOTE which was passed down to the csvSetOption() function. However the lower-level csv functions did not call csvSetOption to initialize the delimiters. It was up to the application programmer to include csvSetOption in their user-code. Now, the delimiters are initialized when the COZCSVLIB is loaded. This means that the default delimiters (quote, double quote, and comma) are established when the csvOpen is performed. Users can still modify those values by calling csvSetOption() before or after the csvOpen--in fact, at anytime--but now they are initially setup for you when your own application evokes the COZCSVLIB service program. Finally, the RMVBLANK option has been added. This option allows you to control whether or not leading and/or trailing blanks are trimmed off the output data. Previously the CPYTOCSV command always trimmed trailing and leading blanks. This is still the default, but is now controllable via the RMVBLANK parameter.

The csvOpen function has been modified in cozTools. The 3rd parameter (Replace existing IFS file content) now defaults to '0' (no). Using this default or '0' shall append (add to) the existing file when csvWrite is performed. If the IFS file does not exist, this parameter is ignored and the file is created.

Version 2.5 Build 13291

SAMPLES - All samples are have been compiled to TGTRLS(V5R4M0) and shipped as objects along with their source code in the distribution.

CPYOUTQ - The CPYOUTQ (Copy SPOOL Files from One Output Queue to Another) command has been enhanced. It has the following new features:

  • Support for multiple output queue names on the TOOUTQ parameter.
  • Filtering (selection) of SPOOL files by Created-On System name.
  • Filtering (selection) of SPOOL files by Creation Date/Time range.

SAVSPLF - The SAVSPLF (Save SPOOL file to BLOB in a Database File) has several updates and a few bug fixes.

EMAILSPLF - The EMAILSPLF (email SPOOL file) command has been enhanced and is now included in the COZREGEXIT CL program that registers our tools as an Exit Program for WRKOUTQ, WRKSPLF and related IBM-supplied panels. To email a SPOOL file, install the Exit Point Program (by calling COZREGEXIT one time) then use option E on WRKOUTQ, WRKSPLF and related panels.

ASKDATE tool has been enhanced. A new RTNSEP (Return Date Separator) parameter allows you to force the returned date to not include date separators. Normally when a character CL variable is specified, the returned date format includes separators. Now the RTNSEP(*NONE) parameter option causes the returned value to not include separators. This is the same as specifying a zero with the date format (e.g., *MDY0) but is easier and closer to the CL style of doing things. The default is RTNSEP(*NONE) since normally dates in CL do not use separators. There is also an option of RTNSEP(*FMT) which causes the returned date format parameter and the returned date value's return CL variable data-type to determine whether separators are returned.

ASKUSER function has been migrated from RPG xTools to cozTools. The function ASKUSER That prompts end-users for a reply using a DDS-based Display File was ported to the cozTools. Users of cozTools normally would use the sndInqMsg function (send inquiry message, wait for reply). But this user had wide-spread use of ASKUSER, so we ported it. It is stored in the new COZUSRLIB *SRVPGM rather than in cozTools itself. But it is automatically imported into your apps when you /INCLUDE the ASKUSER member.

The CTEDIT (cozTools EDIT) function now supports "blank transparency" for decimal data errors. If ZONED or PACKED data is equal to X'40' (all blanks) it returns zero. If ZONED data has a zone other than X'Fx' it changes it to an F. For example, ABCD or (X'C1C2C3C4') is translated to X'F1F2F3F4') or '1234' before the edit is applied. Internal tools impacted by this update include the CPYTOCSV, CPYTOXML and csvWrite functions. Previously that would fail when a record with a decimal data error was detected. Now they substitute a zero and continue. NOTE: The CPYTOCSV command uses the SQL engine to retrieve data, which itself purges out (skips) records with decimal data errors. This behavior continues with this release.

RTVSPLFA - The RTVSPLFA (Retrieve SPOOL File Attributes) CL command has been enhanced. The new USRPRF parameter allows the caller to request the last SPOOL file for a specific user.

DSPOBJLVL - The DSPOBJLVL (Display Object Level Information) command now supports all object times. Previously the command was created for *PGM, *MODULE, *SRVPGM objects, then *FILE objects were added. Today we have removed the restriction and any object type may be specified.

CLDIFF - The new CLDIFF (Calculate Date/Time Difference) command continues our support for CL commands. It calculates the duration between two date or two time values in CL. The input date/time values must be character, and the resulting duration value is returned to a CL variable of *DEC or *CHAR format. CLDIFF joins other CL-specific commands in cozTools, including RTVDATE, CLCONVERT, CLEDIT, CLREPEAT,CLRIGHT and CLSCAN.

To calculate the difference between two dates using CLDIFF:


               *BCAT &AGE *BCAT 'days old.') 

Running this CL script on my system produced the following message in the joblog:

  • QCMD is 1459 days old.

RTVJOBDA - The new RTVJOBDA (Retrieve Job Description *JOBD Attributes) command may be used to retrieve some of the attributes for a *JOBD object, including the library list associated with the *JOBD, the User Profile, Logging and several other attributes. This command was created to provide a way for users to create JOBD objects that contain a pre-defined library list and then retrieve that library list at runtime--perhaps to use in a subsequent CHGLIBL command, but it has other uses as well.

CPYSRCMBR - The new CPYSRCMBR (Copy Source File Member(s)) command allows you to conditionally copy source file members from one source file to another. The conditioning may include new members, old members, old and new members, members with a newer source last change date or a newer creation date. 


Version 2.5 Build 13262

ASKDATE had an issue with the *CYMD date format. This has been resolved in this build.

Version 2.5 Build 13253

ASKDATE - The CL Command ASKDATE has been released (it was previously in Beta) It now allows custom prompt text, custom date-format input, and several methods to retrieve the date entered by the user. The command allows 3 different types of date entry within a CL program: (1) Normal/single date value; (2) Two dates (a date range); and (3) Month and Year only.

cvtDate and cvtDateEx subprocedures are being introduced with this release.  The CVTDATE subprocedure converts numeric values that are considered dates to the application (i.e., legacy numeric "date" values) to another date format. The returned value is also a numeric value. The CVTDATEX subprocedure converts legacy date values in character format (with or without separator symbols) to another date format. These two functions are being introduced to help customs with legacy database files containing numeric or character fields with "date" information stored in them. For example, if a 6-digit zoned decimal field in a database file contains a date value in MDY format, you can use CVTDATE to convert that date to YMD or even ISO format, e.g.,  dyYYMMDD = cvtDate( ORDDTE : '*MDY' : '*YMD')

CVTDATE works with numeric fields, while CVTDATEEX works with character fields.

getDateFmtCode subprocedure returns the expanded format code for a date format. For example, *MDY is returned as MM/DD/YY while *ISO is returned as YYYY-MM-DD. These values may be passed to IBM i APIs such as the CEEDATE functions.


Version 2.5 Build 13226

CPYTOCSV has been substantially improved since its original implementation. It has improved functionality and much better performance. It now allows the user to specify a list of fields to be included in the resulting CSV file, a list of field to omit from the resulting CSV file, and you may now specify the Select/Omit criteria using standard SQL WHERE clause syntax. In addition the sequence of the data as stored in the CSV file may be specified using a standard SQL ORDER BY clause. Specific to build 13226, CPYTOCSV has had two enhancements that resolve an issue that some users were experiencing when converting non-standard data to CSV. While CPYTOCSV converted the data properly, MS Excel would interpret the data in a way that was unexpected by our users. We've modified CPYTOCSV to be compatible with MS Excel's expectations. 

FIX: Implemented a work-around for another bug introduced by IBM into V7R1 regarding QC2UTIL1. This error is corrected at runtime if you are running V7R1 and install PTF SI47255 but it is not corrected by any PTF in V5R4 or V6R1. This build of cozTools implements a work-around that avoids the runtime error on any release of the operating system. It is recommended that all current cozTools licensees install this refresh by visiting our downloads page.

Version 2.5 Build 13214

ifsWriter - This new CL command and RPG IV function allow you to write text directly to a named IFS file. If the file does not exist, it is created. If the file already exists, the data is added to the end of the file. For example:  ifsWriter stmf('/home/coztools/log.txt')  data('This is some text that I want written to the file') RCDDLM(*LF)

emailSPLF - This new CL command allows you to easily email a SPOOL file to an email user. The SPOOL file is automatically converted to TEXT or if running IBM i v6r1 or later, to *PDF and sent as an attachment. This utility requires our free SendMail add-on library available at no additional charge to paid cozTools licensees.

CPYPRTF - The Copy Print (SPOOL) File command has been updated to support both *PDF (which is previously support) and *TEXT as output options. This allows users on V5R4 and later to copy a SPOOL file to a plain ASCII text file on the IFS. Previously output to another OUTQ or to a *PDF file was supported. *TEXT is now supported by CPYPRTF. 

SPLFNAME(*LAST) - A bug in our internal module caused blanks to be returned when the *LAST SPOOL file name was requested. This occurs only in some rare cases where the user had no SPOOL files in the current job. SPLFNAME(*LAST) on the CPYPRTF and EMAILSPLF commands has been enhanced to now return the last SPOOL file name created by the current user--even if that SPOOL file was created in a different/earlier job.

CPYTOCSV - Corrects a minor issue when the double-quote symbol is detected inside of a field being copied to CSV and that appears as the last character in the field.

Version 2.5 Build 13207

CPYPRTF - The command's substitution symbols for User, Job User and SPOOL File Owner have been streamlined. This impacts when the command it used to copy an existing SPOOL file to a PDF file on the IFS. Please check your compiled CL programs that may use specific substitutions, such as %u, %j, %s, etc. and check the helptext for the current uses. (NOTE: Most users do not use these substitution values.)

makePath and MakePathEx - A new makePathEx function has been introduced. This function is similar to the original makePath function except its resulting path is returned to the first parameters instead of a function return value. This both improves performance and circumvents an issue with IBM i RPG runtime on V7R1. Users who utilize makePath may want to verify that they are receiving the expected returned path and not blanks. If blanks are returned, then your system has this bug. Switching to makePathEx (which is a syntax change) is a work-around for this RPG runtime issue.

QUSAPIBD - The IBM-supplied QUSAPIBD binding directory in the QSYS library has been causing issues on some systems. The first is that the new QZIPUTIL service program has not been included, the second is that some objects are not properly binding to end-user programs and service programs at compile time. This produces a strange problem during runtime. One way to see if you currently have this issue is to use the cozTools DSPVER command. If it fails, you have this issue. With this release, we have "hard coded" our programs to these binding directories, which seems to resolve the issue in most cases. We are unsure as to what IBM did wrong, but they have been creating some object in System State that were previously in User State due to new programmers being used to build IBM i software. This means each one of these would need to be corrected via APAR or other support options, with IBM. The issue is resolved on machines running V7R1 that have the latest CUM PTF package installed. If you are still running V5R4 you may experience this issue until it is resolved by IBM.

Version 2.5 Build 13191

CLCONVERT allows CL programs to convert the data in a CL variable to all upper or all lower case, or to another CCSID (character set). This command deprecates the beta CLCASE and CLXLATE commands, which it replaces.

New xLateXXXXXX translation functions have been added. The new functions replace the legacy cvtCCSID functions along with several cvtCASE functions. Although the legacy implementations have been routed to the new functions, programmers should use the new functions when updating existing code, or writing anything new.

Version 2.5 Build 13174

The cvtCCSID, openCCSID, closeCCSID, and cvtCCSIDEx functions have been rewritten in C for better performance and more accurate translation between CCSIDs.

CLEDIT command processing programs have been reimplemented in C for better performance.

COZSQLLIB - A new Service Program, COZSQLLIB has been introduced. This library contains functions that allow you to access data using SQL without the need for the 5770-ST1 licensed program. It is not a replacement for Embedded SQL, but rather an API library that allows RPG or CL developers to run SQL statements and (in the case of the SELECT statement) retrieve the data into the RPG or CL program.

Version 2.4 Build 13166

All prototypes for IBM i CGI APIs have been modified. They now include the *CWIDEN option on their External Proc (EXTPROC) keyword. The CGI service program has been rebuilt with these settings. Any end-user applications that directly call the IBM i CGI APIs using a cozTools prototype, do NOT need to be recompiled, however when they are recompiled the *CWIDEN option will be automatically implemented.

Version 2.4 Build 13164

CPYTOCSV - Substantial performance improvements have been made. In testing on our Power7+ system, the average number of records converted can be as high as 20,000 records per second (RPS) or roughly 48 times faster than the previous method; and with full features enabled we exceed 10,000 RPS or 25 times faster. Testing on a Power5 system averages about 1,200 RPS. In testing on v7r1 and v5r4 systems, this command performs faster that other options. Other changes include an all SQL engine, and consequently end-users may specify an ORDERBY and WHERE clause (which join our previous field selection) parameters to selectively extract only the data you need. The ORDERBY clause is pretty straightforward. The WHERE clause is a feature that provides the ability to not only do select/omit processing, but also use SQL subqueries. You can actually embed a nested SELECT statement within the WHERE parameter just as you would embedded or interactive SQL.  To facilitate these enhancements an optional correlational name may be specified on the new AS parameter.  Then that correlational name may be used in subqueries on the WHERE clause, when necessary.

CPYFRMPDF - The command has been improved. Some PDF formats (specifically those not created from an IBM i process) would not print properly. Now the PDF image is sent directly to the target print device. Tests indicate it performs better and is more accurate than the previous version. NOTE: CPYFRMPDF requires that the printer support "Postscript 3" or in most cases "direct PDF". If your printer does NOT support "direct PDF" unpredictable results may occur.

CHKNAME - The Check Valid Name (CHKNAME) command verifies that a string or CL variable contains a valid name. Three valid name choices are available along with special symbol processing. Use this command within CL to verify that the user entered a valid Object Name format before sending it to a subsequent CL command. Message CPF019D is sent as an *ESCAPE message if the name is not valid.

POPUPTEXT - The Display Popup Text Window (POPUPTEXT) command accepts up to 5000 characters of text which are word-wrapped and displayed in a popup window over the current display file. If the text exceeds the size of the window, it is scrolled (subfile-like). The end-user may press F12 or  Enter to continue processing. Use the new RTVEXITKEY CL command to determine which key was pressed to exit the Window.

RTVEXITKEY - Retrieve last Fn key used to Exit IBM i System Displays (RTVEXITKEY) command. The RTVEXITKEY command has two return parameters. Use this command in a CL program to retrieve which key was used to exit an of the DSPxxx, WRKxxx and most other IBM i operating system screens. In addition, new and updated cozTools CL commands that have a display also set the same interface when an Exit key (F3 or F12) is pressed.  The CL variables returned are 1-position *CHAR values that are 1 if the key was pressed or not 1 if they were not pressed.

 Version 2.3 Build 13143

CPYTOCSV - Two new parameters have been added that allow field selection. The INCFLD (included field list) parameter allows the user to specify the field names to be included in the resulting CSV file, while the OMITFLD (omit field list) parameter identifies fields that are not to be included.

SndEscMsg() - This new function simplifies sending an *ESCAPE message from within RPGIV or other HLL's.

Version 2.3 Build 13127

MOVSPLF, DSPLSTSPLF and GETSPLFA() have been enhanced to support the option of retrieving the last SPOOL file created by the user. Originally they retrieved the last SPOOL file created by the user in the current job. Now, if a user signs off and signs back on, and creates no new SPOOL files, the interfaces will search prior jobs for the current user for the most recently created SPOOL file. The MOVSPLF does this as its default behavior now, but the DSPLSTSPLF requires the JOB(*ALL) parameter to be specified to activate this feature. The getSplfA() function's JOB parameter can be set to *ALL or blanks to activate this function. Use the '*' job identifier on this function to only search the current job for the last SPOOL file.

setExitKey() - This new function allows RPG applications to set the IBM i "Exit Key" area with the function key used to exit user applications. The function accepts one parameter, the Exit Function Key. This can be the AID code from the INFDS/WSDS, or the value 'F3' or 'F12'. Then in a CL program or other HLL program, the programmer can check for the exit key using either an IBM API, or the cozTools getExitKey() function or the upcoming RTVEXITKEY CL command.

Version 2.3 Build 13120

COZCSVLIB - Corrected a subtle bug that occurs when a numeric field's definition contains the same number of decimal positions as its length. For example, a field defined in the database as Dec(3,3) would generate this bug.

COZXMLLIB and CPYTOXML - A new optional XMLHDR (XML Header) parameter allows a standard XML header (something like <?XML version=1.0"?> to be optionally inserted as the first line of XML. The values for each of the parameters for the header my be specified by the user on the CPYTOXML command or by using one of the cozTools XML functions.

ASKDATE - A new function and command have been added that allow the end-user to be prompted for a single date or date range. The function generates a dialog box (window) with one or two date input fields. The initial value, format and return format are controlled by the command and function.

Version 2.3 Build 13105

COZCGILIB - Our CGI library (service program) has been rebuilt using THREAD(*SERIALIZE) for all modules. This allows cozTools CGI interfaces to be used safely in a multi-threaded environment. This option was selected over the IBM i v6r1 THREAD(*CONCURRENT) due to the current version of cozTools being v5r4 compatible. Towards the end of 2013, a THREAD(*CONCURRENT) version will be provided for v6r1 and later.

STRPRTMON - The Print Monitor system has been enhanced to allow users to be added to the monitor even when a restricted list of User Profiles has been specified on the USER parameter when the command is initially run. Users may be added to the print monitor by inserting the User Profile into a named Data Area that is on the library list of the Print Monitor job. The data area name, by default is QPRTMONUSR but may be any user-specified data area name. Specify the data area name on new USRDTAARA parameter of the STRPRTMON, CHGPRTMON and ENDPRTMON commands.

COZCSVLIB - The tools that utilize the CSV library (service program) have been rewritten to leverage our COZDB2LIB functions previously introduced. This allows us to perform database I/O faster and also allows the functions to work even when the database fields contain NULL values. Native RPG does not allow NULLS it be ignored or "passed through" unless the file is opened for UPDATE. When converting to CSV, the DB2 files are opened for read-only thus causing the issue with NULL-capable fields. Switching to the cozTools COZDB2LIB resolves this issue.

Version 2.3 Build 13091

GetCallerPgmName - This function returns the name of the program that called the function in which the getCallerPgmName() function is called. In other words, "Get My Caller Name" returns the name of the program that called your program.

dlyJob - Performs a "sleep" or DLYJOB (delay job) function without using CPU cycles. This is a much better and more efficient and reliable solution than using the legacy DO LOOP method to delay a job for 2 to 10 seconds. There are 3 versions of the DLYJOB function:

  • DLYJOB() - Specify the delay job operation in seconds.
    • e.g., dlyjob( 20 )  // Delays for 20 seconds
  • DLYJOBTM() - Specify the delay time using a TIME variable with the Hours, Minutes and Seconds set to the delay time.
    • e.g., dlyjobTM( T'00.10.30')  // Delays the job for 10 minutes and 30 seconds
  • DLTJOBEX() - Specify the delay time as separate parameters of Days, Hours, Minutes, Seconds.
    • e.g., dlyjobEX( 1 : 2 : 30 )  // Delays the job for 1 day (24 hours) + 2 hours and 30 minutes.

GetSbmJobA - This function returns information about the job that submitted the job in which the function is called.

GetJobType - This function returns the type of job being run. The return value I=interactive, and B=Batch.

chgJob - This function allows you to modify four basic job attributes including: (see example)

  1. LOG - Log level. This parameter is passed in as a characters string in the format '4 00 *SECLVL' or any other variation of the LOG parameter of the CHGJOB command.

  2. LOGCLPGM - Log CL commands. This parameter may be *YES or *NO to allow you to change the LOG CL Command attributes.

  3. OUTQ - Output Queue. Specify the name of the output queue to which you want to route printed output from the job.

  4. JOBLOGWRAP - Controls how full joblogs handle messages. The valid options are: *SYSVAL, *NOWRAP, *WRAP, and *PRTWRAP

COZCGILIB - The cgiGetVarDate() returns a text string from any HTML webpage in true date format. The function was not working when dates where returned that included separators. This has been corrected with this release.

Version 2.3 Build 13081

COZDB2LIB - With this release, we are shipping the DB2 Record I/O wrapper library. This library simplifies some of the _Rxxxx APIs that perform record I/O. With the initial release we are including the following functions:

  • dbOpen - Open a database file.
  • dbRead - Read next record.
  • dbINFDS - Retrieve INFDS information into an INFDS format data structure.
  • dbPosition - Similar to RPG's SETLL opcode.
  • dbClose - Close database file.
  • dbEOF - Test dbRead operation to see if you hit EOF.

While this is not a complete set of DB2 record I/O interfaces, it is our objective introduce addition dbxxxxx() functions in future releases. There is an example on our Sample Code page. In addition any _Rxxxx() functions may use the file handle returned by dbOpen and used by our other dbxxxxx() functions.

The advantages of yhe dbxxxxx() functions include that they can be used as file agnostic operations. The file name and structure is specified at runtime. In addition an open file handle can be passed as a parameter to subprocedures. And last but not least, the dbRead operation can be coded directly on a DOW, DOU or IF statement to avoid redundant READs or duplication of conditional statements.

RTVDATE - The RTVDATE (Retrieve Date) command has been updated to include a WHEN parameter. Now the returned date can be modified based on what day of the week or date is returned. For example if you retrieve the *EOM (end of month date) and that date is a SUNDAY, you can have the command automatically adjust the returned date from the EOM date to the previous or next Week Day date.

Version 2.2 Build 13074

CPYTOCSV - The CPYTOCSV command has been enhanced. There is now an option to wrap numeric data in a formatting code to avoid zero suppression by MS Excel (specify COLFNC((*TEXT fldname)) to enable this feature. The 2nd enhancement changes the way we read IBM i DB2 database files. Previously when a database file contained a date field and that date field's null attribute was set to NULL, the record would be skipped. The command has been enhanced to avoid this issue with NULLs in the database.

Other misc enhancements are included.

Version 2.1 Build 13070

CRTSAVL - Create Save/Restore List. This command allows you to populate a QSRSAVO API data structure with a list of omitted library and object names. That structure may then be used on a SAVLIB or SAVOBJ command's CMDUSRSPC parameter. The omit libraries and objects are omitted. This allows you to control which objects are NOT saved by managing the "omit list" external to your backup routines (e.g., such as a CL program that does a SAVLIB LIB(*ALLUSR)).

Version 2.1 Build 13064

SCANRPL - The new Scan and Replace (SCANRPL) command  scans a source file member or all members in a source file for a search pattern and replaces it with a new value. Its purpose is to allow you to update source code in mass. Only source members may be searched and only records that contain the search pattern are updated. Upper/Lower case scanning is permitted or case-insensitive scanning may be performed. There is no "UNDO" function so you may want to limit this command's authority to specific developers.

SQL cvtdate UDF Function - The first of what we hope will be many SQL functions or UDF's (user defined functions) premières with this release. This function allows you to convert legacy fields in a database file to true DATE data-types within an SQL statement. The legacy date field can be numeric or character and if it is in a format other than YMD, the format may be specified. The syntax of CVTDATE follows:

 SELECT  ordnbr, cvtdate(orddte, 'mdy'), cstnbr FROM ORDERS where cvtdate( orddte ,'mdy') BETWEEN '2012-01-05' and '2013-03-01'

The 6-digit zoned decimal field named ORDDTE contains the order date in MDY format. The CVTDATE function is used to convert it to a true date so that the date range selection (the WHERE clause) can be used to select the proper subset of data.

The supported formats that CVTDATE can convert from, include: mdy, ymd, dmy, iso, cymd, or cymdhms.

If no date format is specified, it assumes the date is stored in YYMMDD format. The date may be stored in a numeric or character field within the database. Trailing and leading blanks are automatically omitted/trimmed so that if you have a field that is (for example) Char(12) that contains '12-07-31' the cvtdate function will trim leading and trailing blanks, as well as the dashes and use 120731 as value that is converted.

Please note that all UDF functions in cozTools are included in the runtime, however they can only be installed by our Developer Edition Customers.

Version 2.1 Build 13050

With this release we have moved to a stable build of IBM i. Our original system was being leased and the 3rd party maintaining it messed up the PTFs during an upgrade to TR5. This caused all kinds of issues. We've moved the code to a new system that is maintained very accurately and have completely refreshed the build.

Significant Changes in v2.1

QPGMR is now the OWNER of the shipped objects. Previously, QDFTOWN was the owner of the objects in cozTools. Many users say they were changing the owner to a local user profile, while others suggested QPGMR or even QUSER would be a better choice. Starting with Version 2.1 and build 13050, cozTools is now shipped with OWNER(QPGMR).

Existing customers who already have cozTools installed prior to this build, should do the following before restoring this new version:

Issue a CHGOWN command on all the objects in cozTools to QPGMR. This can be achieved by running the following command:


This will change the existing owner of all objects in cozTools library to QPGMR.

If you want to retain the current QDFTOWN user profile, then you do not need to run the CHGOWN command. During an update install of cozTools, run the RSTOBJ command normally, with the following parameters:


Version 2.0 Build 13043

DLTRCD - A new CL command, DLTRCD (Delete Database file Records) has been introduced. This command allows you to delete records from an existing database file using classic SQL or specific data in the database record. It was created to avoid legacy systems where CPYF with INCCHAR or INCREL parameters are used to copy a file back and forth simply to remove unwanted records. This CPYF procedure is often the cause of Remote Journaling ending for some users. For example:


The above command would delete all the records in the SALESORD file in library APLIB that contain the letter 'D' in the DLTSTS (Delete status) field. Any valid SQL WHERE clause for the file indicated, may be specified.


In this example above, all records from the SALESORD file that contain the letter 'D' in position 1 of the record are deleted. Field names and positions are ignored.

CPYCOZTOOL - Now when a cozTools is copied using CPYCOZTOOL, the copy checks for *CMD objects and modifies the PGM parameter. It removes the qualifier to the cozTools library and changes it to your own user library name. As always, if you create a duplicate of a cozTools component, when an update is installed, you will need to re-copy that component in order to apply any enhancements or updates.

Version 2.0 Build 13035

Bug fixes and other improvements. COZCGILIB enhancements.

Version 2.0 Build 13016

CPYTOXML - The LINEFEED parameter has been renamed. It is now consistent with our CPYTOCSV and IBM's CPYTOIMPF command. The new parameter name is RCDDLM (Record Delimiter).

CPYOUTQ - The helptext has been updated and the JOB parameter is highlighted for clarity.

Version 2.0 Build 13012

CHGPRTMON - Enhanced the Print Monitor system to include the ability to "restart" Print Monitoring for a given job and specify the active/current Print Monitor Data Queue. A previous STRPRTMON command must have been run in order accommodate this new functionality. This gives users the ability to disable ('turn off') print monitoring for a given job and then turn it back on for that same job.

RTVENVVAR - The Retrieve Environment Variable (RTVENVVAR) Command has been added. It allows a CL program to retrieve the current value for an environment variable. See the online documentation page for more information.

Version 1.9 Build 12366

Updates to the CPYOUTQ and CPYPRTF commands regarding PDF naming have been introduced. The changes include the SPOOL File Number in the default PDF name to avoid situations where duplicate SPOOL File names were causing identical PDF file names to be generated.

WRKAPPDFT - The Application Defaults functions are now available via the WRKAPPDFT or APPDEFAULT source member in the QCPYSRC source file. Previously the includes were only available via another, internal member name. Use /INCLUDE cozTools/qcpysrc,wrkappdft to include this set of functions in your own RPG applications.

JOBLOG - Changed the joblog function so that it no longer truncates leading blanks. It now truncates only trailing blanks. User-written apps that utilize the existing JOBLOG interface will not see this change until they have been re-compiled.

Version 1.8 Build 12353

makeLower - Converts a fixed-length character field to all lower case characters. Unlike the cvtCase function which converts the input data by copying it to a work variable and returning it to the caller as the return value, the makeLower function converts the data in the field specified on the first parameter to lower case.

makeUpper - Converts a fixed-length character field to all UPPER CASE characters. Unlike the cvtCase function, the makeUpper function converts the data in the field specified on the first parameter to upper case.

Version 1.8 Build 12340

Several cozTools have been recompiled with ALWNULL(*USRCTL) to allow Files with NULL capable fields to be processed (for example, CPYTOCSV, CPYTOXML, CGILIB).

Version 1.8 Build 12338

CPYTOCSV - The CPYTOCSV (copy to comma separated values) command has been changed. It now contains parameter keywords that mimic the IBM i native CL command CPYTOIMPF. The TOSTMF, RCDDLM, FLDDLM, STRDLM and STRESCCHR parameters have been incorporated into the CPYTOCSV command. The legacy CSVFILE, LINEFEED, COMMA, QUOTE, and ESCQUOTE parameters are no longer supported. In addition the FLDDLM parameter supports the *TAB special value to more easily generate tab-delimited files. The STRDLM and STRESCCHR have been updated to support the same default values as the IBM i command. If you have incorporated CPYTOCSV into a compiled CL program and use any of these legacy parameters, you will need to modify the CPYTOCSV command in those CL programs or job scheduler entries. This change was made at the request of a high-profile Developer Edition customer who is replacing many IBM i CPYTOIMPF command statements with cozTools' CPYTOCSV command. The following table may help you easily migrate any embedded legacy CPYTOCSV command parameters:

New Parameter Legacy Name

CPYOUTQ - The CPYTOUTQ command generates an error when a SPOOL file it is attempting to copy has gone from the RDY state to the FIN state between the time the SPOOL file list was generated and the actual copy was performed. Obviously you cannot copy a SPOOL file that has already printed and is in the FIN state. This message is now trapped and the command continues processing the remaining SPOOL file entries.

Version 1.8 Build 12322

CPYOUTQ - The CPYOUTQ command had an issue in some situations that prevented it from copying the contents of an output queue when the target was on the same system as the original OUTQ. This has been correct in this build.

Version 1.8 Build 12320

cpytoXML - The CPYTOXML (copy DB2 to XML) command has been enhanced. It now supports an optional user-specified escape sequence. Normally XML escapes only 5 characters, however when XML is sent over HTTP or via Web Services additional characters beyond the standard 5 that XML normally escapes, may also need to be escaped. The new EXTRAESC parameter allows you to specify up to 255 additional characters that should be escaped by the command. For example to escape the percent sign, specify EXTRAESC('%') and the command will insert &#37; into the XML data.

RTVDATE - When a Julian Date Format was requested, the command would ignored the input date and time. This has been corrected.

Version 1.8 Build 12318

The CPYSRCRMT command has been updated to auto-detect the current version/release of the operating system and either ignore or apply the SRCTYPE parameter. The SRCTYPE parameter was introduced to the IBM i CPYSRCF command in V7R1M0, however the CPYSRCF and cozTools CPYSRCRMT command run on earlier versions. Now CPYSRCRMT detects if v7.1 or later is being used and includes the SRCTYPE parameter accordingly.

cvtDate - The Convert Date function has been added. It converts legacy "date" values between formats. Specifically it converts a date value in a numeric variable to another date format and returns it as a numeric value. Use this function in place of the legacy techniques such as MULT 10000.01 or data structures to convert those numeric "dates" in free-format. For example, a 6-digit date stored in a database file as MMDDYY format, can be converted to YYMMDD format by cvtDate by specifying the following:

  ordDate = cvtDate(ORDDTE);

By default, cvtDate will convert from MDY to YMD format. However, a 2nd and 3rd parameter with from and to date format codes may be specified to override the default. For example to convert from *MDY (MMDDYY) to *ISO (YYYYMMDD) format you could specify the following:

ordDate = cvtDate(orddte : '*MDY' : '*ISO');


ordDate = cvtDate(orddte : 'MDY' : 'YYYYMMDD');

Using a leading asterisk in the standard date format codes is optional.

Version 1.8 Build 12312

The CLCASE CLEDIT CLREPEAT CLRIGHT and CLSCAN have been formally released in this build. Changes over the beta include return variable parameter name is now consistent with the CHGVAR, that is the return parameter is now VAR on all the commands.

SAVROLLING - The command has been modified so that it now starts the generations naming without a numeric suffix. That is, the most recent generation is now the a save file with the same name as the library being saved. This change was implemented from a request by one of our Developer Edition licensees. They wanted SAVROLLING to save any library regardless of the length of its name. (Previously, SAVROLLING would not save libraries with 10-position names.) Now the command saves any library to a save file with the same name as the library. Then the previous SAVROLLING save generation (also known as "n-1") is now named libname1 and 2nd generation "n-2" is named libname2 and so on. When restoring, specify the save file with the same name as the library to get the most recent SAVROLLING-created save file or use the numeric sequence/suffix to get 1 generation old, 2 generations old, 3 generations old, etc.

RTVDATE - The RTVDATE command has been updated. The returned value may now include the time.

getJobStartDate() - This subprocedure returns the date a job started ("became active").

getJobStartDts() - This subprocedure returns the timestamp (RPG IV data-type 'Z') of when the job started ("became active").

getJobSbmDate() - This subprocedure returns the date a job was placed on the job queue (for non-interactive jobs only).

getJobSbmDts() - This subprocedure returns a timestamp (RPG IV data-type 'Z') of when the job was submitted to the job queue. (For non-interactive jobs only).

cpyDecTrunc() - The Copy Decimal with Truncation subprocedure copies a numeric value or expression to a target variable, similar to the MOVE or Z-ADD opcodes. The value is truncated if necessary in order to fit in the result field. Use this when converting legacy RPG MOVE or Z-ADD opcodes to free-format. Those legacy opcodes would naturally perform high-order truncation when a value overflows its target/result field. Normally, the EVAL and implied EVAL operations in free-format issue an exception message at runtime when high-order truncation occurs. MOVE and Z-ADD simply truncate the value. The cpyDecTrunc subprocedure can be when MOVE and Z-ADD behavior is desired.

chkDecTrunc() - The Check for Decimal Truncation (aka, Check for Decimal Overflow) subprocedure will return TRUE if the value specified is too large to fit in the indicated target variable size. Use this to avoid high-order truncation errors at runtime. The ChkDecOvr (Check for Decimal Overflow) is an alias for this subprocedure.

    if chkDecTrunc( qtrSales + sales : %dec(qtrSales) : %decPos(qtrSales) );
// The SALES value is to large to fit into the QTRSALES field!
// Go ahead, it'll fit.
qtrSales += sales;

Version 1.7 Build 12307

CPYOUTQ - Corrected a bug in the naming of PDF files when copying to PDF files.

CPYPRTF - Corrected a bug in the naming of PDF files when copying to a PDF file.

Version 1.6 Build 12305

STRPRTMON - The STRPRTMON (Start Print Monitor) command has been enhanced. Some default values have been changed to be more consistent and intuitive. Minor bug fixes have been made, and the SPLFOWN (SPOOL File Owner) parameter has been added to allow the copied SPOOL Files to be assigned a different and specific owner. 

DSPOBJLVL - The DSPOBJLVL (Display Object Level) command has been enhanced. It now displays the System Created On when that system is different from the one running the command. For example, if program PGMA is created on SYS1 and is transferred to SYS2 when DSPOBJLVL is run on SYS1, the list entry for PGMA is the same as always. However, when DSPOBJLVL is run on SYS2, it will show that PGMA was created on SYS1. This can be very helpful in a multi-system environment to determine if custom changes have been made to an object that is normally centrally maintain and distributed. This information is inserted over the Version information but retains the TGTRLS information on the report.

Version 1.6 Build 12304

CLREPEAT - The CLREPEAT command copies a value repeatedly to a CL variable. This is intended to allow an RPG-style EVAL X = *ALL'xyz' feature in CL. Most recently the need to initialize CL variables to all Hex zeros (X'00') has been important, the CLRepeat command allows you to easily accomplish this task. CLRepeat joins our CLScan, CLCase and CLEdit commands that enhance CL programming by providing practical features that are not normally available.

SNDPRTF - The SNDPRTF command has been enhanced to support the SPLFNAME(*LAST) feature. Also a bug when sending to *LOCAL has been corrected.

CVTOUTQRMT - The CVTOUTQRMT command has been changed. The HOLD parameter has replaced the STS (status) parameter as most users preferred HOLD(*YES|NO) instead of STS(*HOLD | *RLS). Since CVTOUTQRMT is never intended to be used in compiled CL programs, we accepted this change request and implemented it in this build.

Version 1.6 Build 12300

CPYFRMPDF - The CPYFRMPDF (Copy From PDF on the IFS) command is introduced. It copies a PDF file stored on the IFS to a system or network PRINT file. The data in the PDF file is read by the command and then written to the target PRINTER device file. The user is responsible for insuring that the target PRINTER supports PDF printing, natively.

CHGPRTMON - The command no longer attempts to insert the necessary environment variable into the local job if a pervious STRPRTMON has not be used to create the Print Monitor Data Queue. This avoids a joblog message that can occur on system running IBM i5 v5r4. It does not occur on IBM i v7r1 and later.

STRPRTMON - When LEVEL(*SYS) is specified, the program now removes the controlling environment variable at the system-level upon completion of the print monitor.

scanRPL - Our SCANRPL subprocedure (a pre-v7r1 alternative to %SCANRPL) has been enhanced to correct a bug that could occur when the replacement text is longer than the searched-for text.

Version 1.5 Build 12290

RPGFREE - This new service program has been introduced with this build. The RPGFREE service program is a no-charge runtime library of some of the cozTools core functions. It is included in the runtime-only package as well as the Developer and Enterprise Editions. RPGFREE contains a few dozen useful functions, such as our joblog(), sndmsgid, cvtCase, and most *USRSPC wrappers; making it easy to include such things in any application. With the introduction of RPGFREE, the cozTools now includes both free CL commands and nearly dozens of no-charge subprocedures.

DSPLSTSPLF - Display Last SPOOL File (DSPLSTSPLF) command is introduced with this build. It complements the IBM i DSPSPLF command by allowing you to display the last (most recently created) SPOOL file without knowing the name of that SPOOL file.

CPYPRTF - The CPYPRTF (copy/duplication SPOOL file) command has been enhanced to support PDF output to the IFS. Specify TOOUTQ(*PDF) along with the STMF parameter to specify the IFS file name where the PDF is saved. PDF output requires IBM i v7.1

CPYOUTQ - The CPYOUTQ (copy output queue) command has been enhanced to support PDF output. You can now specify TOOUTQ(*PDF) and include the STMF parameter to specify the IFS location where PDF SPOOL files are generated. PDF output requires IBM i v7.1

Version 1.4 Build 12288

CPYTOCSV - Exposed the "to quote" symbol to the CPYTOCSV CL command. This was a request from a cozTools DE customer. Now the ESCQUOTE parameter of CPYTOCSV may be specified. This gives the end-user the ability to control the character(s) to which any embedded quotes in text fields in the DB2 file are translated. Originally they were always replaced with two consecutive quote characters (the CSV standard) now the ESCQUOTE parameter may be used to specify up to 10 characters to insert into the data when a " symbol is detected. The default remains ""

cvttoChar - The Convert To Character subprocedure (CVTTOCHAR) has been updated to support 3 versions of the 'X' edit code.  'X', 'X-' and '-X'. The three new edit codes allow you to cause the interface to return the raw numbers without zero suppressing them. You can also specify the minus sign's location (before or after) the digits, or not at all. Normally the X edit code simply translates the data and drops the sign. The additional options allow the status of the value (i.e., the minus sign) to be retained. Here's a simple test I ran to show the differences:

RPGIV %editC(... 'X') Results:
Plus = 3276650
Minus = 016502N
Zero = 0000000
cozTools cvtToChar(... 'X') Results
Plus = 3276650
Minus = 0165025
Zero = 0000000
cozTools cvtToChar(... '-X') Results
Plus = 3276650
Minus = -0165025
Zero = 0000000
cozTools cvtToChar(... 'X-') Results
Plus = 3276650
Minus = 0165025-
Zero = 0000000

The RPG IV %EDITC(... 'X') built-in function returns a value similar to cozTools, however the built-in function will embed the negative sign in the hi-order bits of the right-most digit--making it difficult to use in things like XML, HTML, CSV, JSON, etc. The cozTools version will embed an actual negative sign before or after the digits. NOTE: the same feature is enabled in our EDITCODE() subprocedure available by /COPY'ing the CVTEDIT prototype member.

Version 1.4 Build 12286

Online and command-level helptext for all CL commands is now available with this release. Previously no F1=Help support was provided with the cozTools CL commands. Now we not only provide F1 help for the most popular commands, we make it available via our List of CL Commands page on this website. Click on the command name on that webpage and the helptext for the command appears. This also works from within RDp (HTML-help for CL commands).

RTVSPLFA - The RTVSPLFA (Retrieve SPOOL File Attributes) command retrieves SPOOL file attributes for the identified SPOOL File. The command supports a SPOOL file name of *LAST so that if the most current SPOOL File name is unknown (as is often the case) its attributes can still be retrieved. Use this in conjunction with the IBM-supplied CHGSPLFA or DSPSPLF commands to write SPOOL File name agnostic routines.

MOVSPLF - The MOVSPLF command has been enhanced to support SPLFNAME(*LAST) as the SPOOL file name (and yes, we call the new RTVSPLFA command under the covers).

CPYPRTF - The CPYPRTF (Copy/Duplicate SPOOL File) command supports the SPLFNAME(*LAST) When specified, the last SPOOL file (regardless of its name) for the specified job, is selected.

CGILIB - The cozTools CGI Service program, COZCGILIB has been enhanced to support "raw" CGI access. This is a new feature that complements the existing File Upload capabilities of COZCGILIB. It allows a CGI RPG program to, for example, receive a POST operation from a web service such as SOAPUI, SAP or others, and grab the data that was uploaded. The COZCGILIB Service Program inspects the content-type of data being sent and allows it to be saved using the new cgiSaveRAW subprocedure. NOTE: COZCGILIB is the follow-on to RPG xTools CGILIB which itself was a follow-on to the formerly unsupported IBM CGIDEV2 package. This website,,,, and a host of Schools, Banks, and Casino's around the world use CGILIB as their backend for their IBM i-hosted websites. Pretty much any time you want to be able to upload files to your IBM i system via an HTML Web Page and CGI RPG you're choices are PHP or COZCGILIB.

SCANRPL - A bug in the internal scan/replace routine has been corrected in addition the routine has been further enhanced to match the function of the v7.1 %SCANRPL built-in function. Specifically, it now scans and replaces all occurrences of a value.

CPYTOCSV - Improved performance when embedded Quotes are detected within a field being converted. Also fixed a bug that left trailing blanks in character/text fields.

Version 1.2 Build 12272

CPYTOXML  - The CPYTOXML command allows you to copy database records to the IFS in XML format.

Print Monitor System - STRPRTMON, ENDPRTMON, CHGPRTMON commands allow you to manage SPOOL files created. You can copy the SPOOL files upon creation to another output queue or save them to a cozTools SPOOL File Archive using SAVSPLF. A print monitor program named COZPRTMON is also provided. Start the print monitor at the system level, and all SPOOL files are processed, or start it at the job-level and monitor on demand on a job-by-job basis.

EditDate - Call this subprocedure from RPG IV to convert a valid date into text. You pass a valid date data-type to it and request that it be returned in text using a user-specified text formatting code. An example returned format could be 27Sep2012 but any user-defined format is supported.

SndInqMsg - Call this subprocedure from RPG IV to send a message to the *EXT message queue and waits for a reply. The reply is returned to the caller. This is similar to the SNDUSRMSG CL command in the way it works.

FastScan - This subprocedure is used to perform a scan, similar to %SCAN. This function is suited for larger areas that need to be scanned as the scan is substantially faster than %SCAN. To keep performance at a maximum, FastScan is case-sensitive.

SENDOBJ - A bug in SENDOBJ prevented the RSTLIB parameter from being properly interpreted; it was ignored. This bug has been corrected in this build.

CPYOUTQ - New parameters have been added for SAVE and HOLD SPOOL file attributes. The copies produced by CPYOUTQ can be assigned the SAVE(*YES) and/or HOLD(*YES) attributes.

Version 1.1 Build 12258

CGI Supports raw read/save of the POST buffer stream. This is necessary for non-HTML Form based processing, such as when a POST is issued from iSockets, SAP, Web Services, etc. The capability allows the developer to save the data sent, directly to the IFS. This feature can also be used for traditional POST processing when inspection of the data being sent or logging is desired.

Developer Edition - With this build, the cozTools DE (Developer Edition) becomes available for licensing. This means customers can use the huge library of subprocedures found in cozTools within their own RPG IV applications. You can build your applications to leverage cozTools and ship your programs to other systems and run them. The only requirement is that the free/no-charge runtime version of cozTools has to be installed on those systems. Developer on System A, ship to and run on System B and pay no runtime license. The only fee is for the developer system for the Developer Edition License. Read more on our Licensing page.

The cozTools RT (Runtime Edition) continues to (and shall always) be no charge. (Download RT now for free.)


Version 1.0 Build 12242

SAVSPLF - Corrected an issue that could cause too many records to be created in the SPOOL File Archive. Also added an "Are you sure?" inquiry message when the following parameter combinations are used:


These requests basically mean the user wants to save every spool file on the system. Therefore we issue an "Are you sure?" inquiry message asking the user to confirm the request. Type Y to continue, any other reply ends the request.

CPYPRTF - minor bug fixes

Version 1.0 Build 12236

CLSCAN - This command allows a CL programmer to scan a CL variable. The scan can be performed as case-sensitive or insensitive. The resulting location (called the "position") is stored in a user-supplied numeric CL variable. In addition to the numeric return position, an optional character CL variable may be specified to receive the position in character form, left adjusted, zero suppressed. This allows the programmer to avoid the vexing challenge of converting numeric to character and having it look correct.

CLEDIT - This command allows a CL programmer to convert numeric data to character and apply any of the standard editing codes ('editcode') to the result. In addition Edit Words may be applied if there is no applicable editcode.

CLCASE - This command converts text in CL variables to upper or lower case and returns that converted text to the programmer-supplied CL variable. The source and target CL variables can be the same variable to allow conversion within a single CL variable.

Version 1.0 Build 12234

CVTCASE - The CVTCASE function has been enhanced. The CVTCASE subprocedure now supports up to 64k input/output values whereas the previous version supported only 2k. The cvtCaseEx function has always supported 64k and is unchanged by this build.

SAVLIBL/RSTLIBL - Subtle bug fixes and moved the code down into the cozTools service program rather than be stand-alone programs. This allows us to expose SAVLIBL and RSTLIBL as functions (subprocedures) so that they can be easily called from within RPG IV, in addition to the useful command interface of the SAVLIBL and RSTLIBL commands. No added functionality or performance benefits occur from this build--it only moves the SAV/RST library list functions into the cozTools service program.

Version 1.0 Build 12232

Enhanced SAVSPLF, RSTSPLF, and CPYPRTF (basically CPYPRTF is "Copy SPOOL File") so that they now support "large SPOOL files". This means if a SPOOL file exceeds the 16MB boundary in total size (not page count) the cozTools commands listed here will respect and support that larger size. Note that since there is an internal system limit on the size of the storage component used by the SAVSPLF/RSTSPLF commands, when a SPOOL file exceeds the 16MB size, it will be stored/saved in the USRSAVSPLF database in multiple records. However, the RSTSPLF command will recognize this and restore the full SPOOL file to the target output queue. No changes are required to existing saved SPOOL files archives.

Version 1.0 - CGILIB Now Included - Build 12231 and Later

We've ported the hugely popular RPG xTools CGILIB to cozTools. It is now included at no additional charge. This fantastic library allows you to write web-based RPG programs that leverage other cozTools features or stand on their own. There have been a small number of very subtle changes from RPG xTools CGILIB, but the most important one is the name of the service program in cozTools is COZCGILIB instead of the RPG xTools name of CGILIB.

Library List Functions - New library list management functions have been added. CHGLIBL, ADDLIBLE, RMVLIBLE subprocedures are now part of cozTools. For the most part, the function parameters are similar to their IBM-supplied CL command equivalent, however ADDLIBLE accepts multiple library names at once. Like all cozTools subprocedure functions, they are available in the Developer and Enterprise Editions only, and not licensed in our Runtime only edition.

Version 1.0 - Initial Public Release of cozTools Runtime (RT) Edition

MOVSPLF - Added a MOVSPLF (MOVE SPOOL FILE) command that moves the last SPOOL file to another OUTQ.

CPYTOCSV - Ported the RPG xTool's command CPYTOCSV (Copy to CSV) command to cozTools. This command copies DB2 files to the IFS in CSV (comma-separated) format. It has more features that the IBM i CPYTOIMPF command, including the ability to insert column headings and specify MBROPT(*ADD | *REPLACE) so you can add records to an existing IFS file.

COZCSVLIB - New service program to support CSV and XML generation routines in the cozTools.

COZENCRYPT - New service program to support Encryption and Hash generation routines in cozTools.

COZIFSLIB - New service program that supports interfacing with the IFS.

COZFINANCE - New service program that supports Financial functions within the cozTools.

Rev 0.15 - Refresh Date 01 August 2012

CPYOUTQ - Parameter restructuring.

CPYPRTF - Parameter restructuring.

SAVSPLF - New command. Saves  one or more SPOOL files to a database file, known as a SPOOL File Archive. The exact SPOOL file image is saved and can later be restored to any output queue using the RSTSPLF command.

RSTSPLF - New command. Restores SPOOL files that have been previously saved to a SPOOL file archive, to any output queue. Some SPOOL file attributes may be altered during the restore process.

SAVROLLING - A new parameter TEXT description, has been added to allow the user to specify the text associated with the SAVF (save file) that is created.

Rev 0.12 - Refresh Date 23 July 2012

CPYOUTQ - Corrected a minor issue that can occur in some rare cases. Also added the LOG parameter. When LOG(*YES) is specified, the generated CPYPRTF or SNDTCPSPLF command is written to the joblog using the cozTools joblog() function.

Lists, Compare and CSV - This is the first phase of migrating RPG xTools into cozTools. The List interfaces (create field list, etc.), the COMPARE functions (inlist, dateRange, inRange, etc.) and CSV functions (cvttocsv) have been migrated. Only the subprocedures have been migrated at this point--the sample code will be re-engineered and hardened and then integrated as supported cozTools CL commands, in a later release.

Rev 0.11 - Refresh Date 16 July 2012

RTVAPPDFT - Added a "DFT" keyword and renamed the original "DFT" keyword to "NAME". The App Defaults subsystem has been included in the beta but has not been formally release or documented. This change should have no impact on existing Beta test customers.

COZAPPDFT - Exposed the App Defaults subsystem with this release. This *SRVPGM and commands allows applications developers using RPG IV or CL or C, to easily save and restore application settings between invocations. Similar to the Registry in Windows, or the classic "INI" file. This App Defaults system stores its data in a simple database table on the IBM i system. For additional documentation, visit this link on our documentation website.

Rev 0.10 - Refresh Date 12 July 2012

RTVAPPDFT - This command no longer writes a program message to the joblog when it returns the App default value.

DSPSYS - The current PTF level is now included with the other, slightly restructured information.

getPtnInfo (Get Partition Information) - A problem in the return value has been resolved when a variable of less than 80 characters was passed to receive the partition information.

Rev 0.9a - Refresh Date 10 July 2012

This update is recommended for users of CPYPRTF and CPYOUTQ commands.

CPYPRTF - Adjusted parameter sequence and  improved overall reliability. [Update: Fixed a bug that would cause a copying from job(*) to ignore the request.]

CPYOUTQ - Now, when the target OUTQ resides on the *LOCAL "remote system" CPYOUTQ uses the CPYPRTF command to duplicate each entry. This provides much improved performance over the previous method, and accurately copies the SPOOL file's attributes to the new SPOOL file. Previously, when copying and OUTQ to another OUTQ on the same system, the new SPOOL files were owned by user profile QTMPLPD and showed that they were created by a job named QPRTJOB. In addition, a new job ID was inserted. Now, when performing a copy from/to the local system, the use of CPYPRTF insures that the SPOOL file attributes are copied to the new SPOOL file, except for the SPLNBR (SPOOL file Number) which obviously needs to change. This command will continue to use the SNDTCPSPLF command, internally when the TOOUTQ is on a remote system or in another partition.

New Subprocedures: A large number of new subprocedures have been introduced in this release. The majority of which related to Date-processing (to support the RTVDATE CL Command) but there are others as well. Once the Developer Edition begins its beta test period, we will include specifics about each subprocedure included in cozTools Developer Edition. The Developer Edition planned Beta Test period start date is August 7th.

Rev 0.8 - Refresh Date 27 June 2012

CPYSRCRMT - The command now accepts *FROMSRC on the TOSRC parameter making it easier for the end-user to specify TOSRC(*FROMSRC). Note that the library name of the TOSRC parameter must still be specified, but it may be specified as *FROMLIB. That is TOSRC(MYLIB/*FROMSRC) is permitted, as is TOSRC(*FROMLIB/*FROMSRC).

FTPFILE - Problem with the length of the QFTPSRC being used internally to generate the FTP script was too short. It was defaulting to 100-byte source data area, and should have been 240. This would cause an issue when lengthy commands were generated particularly when including the RCMD parameter with CL commands that exceeded approximately 92 bytes in length. This problem has been resolved.

FTPRCMD - Same issue as the FTPFILE command has been corrected with FTPRCMD.

SENDOBJ - The parameter list has been reworked to the cozTools standard. That is the RMTSYS, USER, PWD now appear before the OBJ parameter on the CL prompter. This is consistent with the SENDLIB and SENDSAVF commands. Existing compiled CL programs should not be impacted by this change.

Rev 0.8 - Release Date 22 June 2012

RTVDATE - This command now supports more options that simplify End of Month and Beginning of Month date retrieval. To retrieve the date of the end-of-month for "this" month, specify:  RTVDATE RTNDATE(&MYEOM) DATE(*EOM)

In addition, a relative date option has been added to allow a relative date to be returned. For example, you can retrieve the date of the 3rd Friday of the month. The date parameter supports 3 components: date, operator, and relative day that provides precise control over the date being returned (should you need it).  In addition, the format of the returned date may not be any of the special values or any combination of Y, M and D providing more granular and global returned-date formats.

DSPVER - The command has been updated to include the current version of cozTools (in addition to the system name and IBM i release level).

SENDLIB - The command has been updated to include controls for the "Allow Object Differences" option on the underlying SAVLIB/RSTLIB commands.

Rev 0.7 - Release Date 12 June 2012

RTVDATE - The Retrieve Date command converts a user-specified date to the user-specified format and returns it into a CL variable. This command will accept a user-supplied date or a pre-defined symbolic day (such as *JOB, *SYSTEM, *TOMORROW, etc.) and convert it to the user specified format, then return the date to the CL variable. An optional duration may be added to the date to allow the CL programmer to retrieve a relative date. For example, if *SYSTEM is specified and DUR(7) is also specified, the date returned by the command is 7 days from the current system date. In addition, a relative-date may be returned in the specified format. That is, the user can ask for the "3rd Wednesday of the month" and the date of the 3rd Wednesday of the month is returned.

WRKPRT - The WRKPRT command has been enhanced. A USER (user profile) parameter has been added to allow the user to not only view "my" printed content, but that of any other user on the system. This is helpful for Systems Administrators who need  to view the SPOOL files for any user on the system for their current job or for a specific date.

COZSPLEXIT - The exit program has been enhanced to support the SNDPRTF and CPYPRTF commands in cozTools. When installed, users working with the WRKSPLF, WRKOUTQ or WKRJOB commands may specify the cozTools options of C or S.

C=COPY  S=Send to Remote System

COZREGEXIT - A new program that will install the Exit Program COZSPLEXIT. To install the COZSPLEXIT program, call the COZREGEXIT program.

SENDLIB - The SENDLIB command saves the specified library to a save file, transmit the save file using FTP (FTPFILE command required) and then restore the library onto the remote IBM i system. Up to 300 library names may be specified, along with the SAVLIB command's TGTRLS (target release) and optionally the RSTLIB (restore library on target system) parameter.

Rev 0.5 - Release Date 5 June 2012

RNMRDBDIRE - The Rename Remote Database Directory Entry command has been added. This command allows you to (as the name implies) rename any database directory entry, including the *LOCAL entry. The authorization method may be specified as *SAME or one of the allowed methods.

SAVROLLING - The Save Rolling Backup command saves one or more libraries to a save file with a sequence number. When SAVROLLING is run a subsequent time, the current SAVF is renamed to the library name +1. For example if SAVROLLING LIB(QGPL) is run, a save file is created in the target library with the name QGPL1. When SAVROLLING LIB(QGPL) is run a 2nd time, the save file named QGPL1 is renamed to QGPL2 and a new QGPL1 is created with the current contents of QGPL saved to it. A user-specified maximum generations may be specified to control the number of generations that remain on the system. When the MAXGEN (maximum generations) limit is reached, the highest/oldest save file is deleted from or "rolled off" the backup library.

SNDMultMSG - The new Send Multiple Message (SNDMULTMSG) command can be used to send the same program message to the joblog in multiple formats. For example, you can send a *STATUS message to the end user and also write the same message text to the joblog as a *INFO or *COMP message. All text is written as CPF9897 messages or as an impromptu message (depending on the message type and system requirements).  Up to 512 characters may be written and up to 8 different message types may be specified and therefore sent simultaneously.

CPYPRTF - The CPYPRTF (Copy/Duplicate Spool File) command copies an existing SPOOL file. The user may specify different attributes for the new SPOOL file, such as SPOOL File Name, Form type, copies, etc. In addition, multiple output queue "targets" may be specified.

SNDPRTF - CPYPRTF from beta .4 now deprecated -  - The Send SPOOL File (SNDPRTF) command replaces the CPYPRTF command introduced in prior beta test releases. The focus of SNDPRTF is to allow SPOOL files to be transmitted to remote locations via the SNDTCPSPLF command. It is also the target when option S is selected on WRKSPLF, WRKOUTQ and WRKJOB commands when cozTools exit program COZSPLEXIT is installed.

CPYSRCRMT - The Copy Source File Remote (CPYSRCRMT) command copies source files from or to a remote system and preserves the source characteristics; the source statement change dates and sequence numbers are preserved. This command uses temporary DDM files to perform the copy and therefore requires the *DDM server to be running and a Remote Database Directory Entry to be setup.

WRKPRT - Work with My Print (SPOOLED) Files. Displays a list of Print (SPOOLED) files created by the current user profile on the specified date. The Default Date is *CURRENT. in addition *JOB may be specified to include all the Print (SPOOLED) File created during the current job.

Rev. 0.4 - Release Date: 23 May 2012

CPYPRTF - The RMTSYS parameter is now a multiple-entry parameter. Meaning not only may the user specify *LOCAL (to copy to an outq on the local system) they may also specify up to 64 remote system names or IP addresses to which a copy of the SPOOL file is sent.

CPYOUTQ - Two new parameters FORMTYPE and USRDTA have been added to filter the SPOOL files being copied. Specify a form type and/or user data to select only SPOOL files that match those criteria.

DSPOBJLVL - The 3 VxRy levels have been returned to the report. These are the Created On System, Object System Level, and Target Release Level. In addition, database files are now included in the report as well as the modules, programs and service programs.

Rev. 0.3 - Release Date: 18 May 2012

DSPSYS - The command's output layout has changed. It now displays the System Name, processor group, and partition ID first, followed by the operating system VxRyMx, CPU use (x of y), the amount of installed memory, and lastly the Disk Usage. This was done to make the Disk Usage more directly visible, and to group the system identity together. In addition, it no longer uses the IBM QPML*  lpar  API to retrieve partition information. The API's service program proved too limited in its availability.

DSPVER - This command has been enhanced. It displays the System Name and IBM i VxRyMz version/release information, along with the cozTools version/build installed on your system.

CPYOUTQ - Fixed a bug in the filter by USER parameter. Previously this parameter was being ignored, now up to 300 user profile names may be specified to filter the files copied to only those created by the specified user(s).

DSPOBJLVL - The object list filtering mechanism has been rewritten. We replaced the TGTRLS parameter with the INCLUDE parameter. Now multiple object attributes may be used to filter the generated list. Among the included filters are TGTRLS (target release), CRTDATE (created on date), CHGDATE (last changed date), OWNER (object owner), CRTUSRPRF (object creator), SYSNAME (created on system name) and PGMENV( Special Programming Runtime Environment, i.e., ILE or OPM). The special comparison value of *CURRENT is applicable to most object attributes, with the obvious exception of PGMENV, which defaults to 'ILE' if *CURRENT is specified.  NOTE that for the CRTDATE and CHGDATE filters, the user-specified date value must be in *ISO format. Meaning the date must be specified as YYYY-MM-DD to work correctly. For example:


Also if no objects match your selection criteria, a message is sent to the joblog indicating so.

SAVLIBL and RSTLIBL - The new SAVLIBL (Save Library List) and RSTLIBL (Restore Library List) commands allow you to save your job's current library list and then restore it at a later time. By default the save area is deleted when the job ends, however you may direct the save to a permanent object in a user library and restore it at a later date. Multiple SAVLIBL commands may be issued, saving each library list in succession to the save area. To restore the library list, run the RSTLIBL command. Each time RSTLIBL is run, the most recent saved library is restored. Once the number of RSTLIBL commands issued matches the number of SAVLIBL commands previously issued, the library list save area is empty an further RSTLIBL are ignored until another SAVLIBL command is issued. The user also has the ability to "keep" the library list in the save area, allowing multiple RSTLIBL commands to retrieve and restore the same saved library list repeatedly. 

CPYPRTF - Fixed a bug when JOB(*) is specified--the command wasn't accepting * for the job identifier.

New Subprocedures in this revision:

MIN - Returns the lowest numeric value from a list of up to 16 values. The limit of 16 as selected to provide enough parameters for 12 months or 13 periods of sales, while also being suitable for general purpose programming, such as the lowest value of a 2 or 3 values.

MAX - Returns the highest numeric value form a list of up to 16 values. See the MIN procedure for additional information.

AVG - Returns the average value from a list of up to 56 values. The limit of 56 was selected to provide enough values to represent a years worth of data when broken down into weeks. While there can be up to 53 weeks in one year 52 full weeks and up to 1 fractional week) the limit of 56 was done to provide a bit of additional space when needed. Note that this is primarily for flat file usage where you'd read a single record with 52 weeks of data in it. Then pass each value (probably as an array element) to the AVG function. If multiple values stored in separate records need to averaged, the data should be processed with an appropriate SQL function instead.

getSrlNbr - Returns the system serial number as a character value.

 Rev. 0.2 - Release Date: 14 May 2012

DSPOBJLVL - Corrected an issue when multiple object names were specified on the OBJ parameter. Added an "object count" to the total/bottom line of the report.

WRKAPPDFT - The Application Defaults subsystem (not officially released but included in this build) now includes substitution values to make it easier to create user-based or job-based defaults. The substitution values &U and &J have been added. They are replaced by the active user profile name and the job name respectively. Simply embed &U or &J within your default label, and the system will perform the substitution for you. For example, if your applications allows end-users to designate the output queue for the applications, previously you can use the following to retrieve the last output queue name used within the application:

  myDefault = getAppDFT('LAST_PAYROLL_OUTQ' );

This is powerful, but it does limit the functionality to a purely system-wide setting for this entry. Assuming the end-user has the option to alter their output queue used by this application, the end-user RPG program might issue the following to save the last output queue upon program exit:


Again a fairly easy way to save and restore application-level defaults in RPG, making the more like applications on other platforms that tailor to the end-user's customization settings.

With the new substitution values, you can now include the User Profile or job name as part of the Default Label ("key") to allow your applications to remember the "last output queue" on a user-profile or job name basis. Of course the "last output queue" is simply an example. The following is how a substitution value may be specified:

 myDefault = getAppDFT('LAST_PAYROLL_OUTQ_&U'); 

If the user profile is QPGMR the default label is translated to LAST_OUTQ_QPGMR so within your applications defaults table (named COZAPPDFT on most systems) you would include an entry for LAST_OUTQ_QPGMR and a similar key for any other user profile you want to include in the application defaults subsystem.

To save the output queue based on the user profile, you would code the following in your RPG IV program:


NOTE: The Application Defaults Subsystem is included in Rev 0.2 however the documentation will not be completed until Rev 0.3 is published. In addition, the AppDefaults subsystem is only accessible if you license the Developer or Enterprise editions, and through the WRKAPPDFT and related CL commands that are included in all editions.

Rev. 0.1 - Release Date: 01 May 2012

CL Commands

  • SENDOBJ - Send Object(s) via FTP
  • SAVLIBSAVF - Save Library(s) to Save Files
  • SENDSAVF - Send Save File via FTP
  • CPYOUTQ - Copy all SPOOL Files in one or more OUTQ's to another OUTQ
  • CPYPRTF - Copy (not "move" but copy) a SPOOL file to another OUTQ
  • CRTSRCLIB - Creates source files in a library and optionally creates the library
  • DSPLIBSIZE - Prints a report of space used by Library with warnings if over user-specified size
  • DSPOBJLVL - Display Object TGTRLS (Target Release) Level
  • DSPSYS - Display IBM i version along with Disk Space Usage and Partition Information.
  • DSPVER - Display IBM i version along with the System Name
  • FTPFILE - Send or Receive Files via PTF with advanced parameters for save files and source files.
  • FTPRCMD - Run a Remote Command using FTP server
  • RNMOBJOWN - Change the Owner of All Objects Owned by the Given User Profile
  • RTVSQLSRC - Retrieve SQL DDL for any existing database file
  • SAVLIBL - Save Library List to the save-area (aka "PUSH" Library List)
  • RSTLIBL - Restore Library from save-area (aka "POP" Library List)
  • SAVLIBSAVF - Save Libraries to Save Files with same name as libraries to a given library
  • RTVEXITKEY - Retrieve the Fn key used on IBM-displays to return control to your CL program
  • CRTUSRSPC - Create a user space
  • RTVUSRSPC - Retrieve user space data similar to the way you retrieve from data areas
  • CHGUSRSPC - Change User Space data similar to the corresponding change data area command.


  • cvtCase - Convert between UPPER/lower Case
  • cvtChar - Convert between CCSIDs (ASCII to EBCDIC)
  • joblog - Write a line of text to the joblog
  • sndMsgID - Send Program Message using a msgid/msgf
  • sndInfoMsg - Send an Info Message
  • sndStsMsg - Send a Status Message
  • GetGMT - Returns the time in GMT
  • GetDTSString - Return Date/TimeStamp in character format with user-specified format
  • fnPmt - Calculate Periodic Payments
  • fnMean - Calculate the mean average of up to 12 values
  • fnPmtH - Same as fnPmt but uses RPG's "half adjust" feature.
  • getDevIP - Retrieve the IP Address of the workstation device
  • getIFSsize - Retrieve IFS file size in bytes.
  • getLibSize - Retrieve library disk space usage and object count
  • getOSver - Retrieve Operating System Release Level in VxRyMz format
  • getSysName - Retrieve the System Name
  • chkObjExists - Check if an object exists
  • parseCSV - Break down a CSV (Comma separated values) string into individual fields
  • getCPUCount - Retrieve a Count of the number of CPU installed on your system
  • getPTNinfo - Retrieve Partition Information

Copyright © 2012 Cozzi Productions, Inc. All Rights Reserved.