Craig Rutledge - Utility Command Prompts

Back to SiteMap.


JCRHFD - Rpg H,F,D to free form syntax

Reads your selected RPG4 source member and generates a new RPG4 source member with H, F, and D specs converted to free format.

RPG source member (RPG4MBR) . __________
Source file (RPG4SFIL) . QRPGLESRC_
  Library . *LIBL_____
New source member to generate (FREEMBR). __________
Source file (FREEFIL). QRPGLESRC_
  Library . *LIBL_____



JCRDDL - Generate data definition language source member

Calls API to generate Data Definition Language source member from the selected data base object.

File (FILE). . __________ Name
  Library . . . *LIBL_____
Database Object Type (OBJTYPE). *TABLE_____ *TABLE, VIEW, etc.
New source member to generate (DDLMBR). __________
Source file (DDLFIL). QDDSSRC_
  Library . *LIBL_____



JCRPRGEN - Generate DCL-PR Call Prototype

Generates DCL-PR prototype definitions in selected source. Enter the name of the program object you wish to call and the name of the source member you wish to call it from.

Insert Prototype into SrcMbr (INSERTINTO). __________
Insert Source File (INSERTSRCF) . QRPGLESRC_
  Library . *LIBL_____
Create Prototype to call Obj (TOCALLPGM) . __________
  Library . *LIBL_____



JCRANZD - Print DSPF Field Layout

Uses the insanely complicated QDFRTVFD, Retrieve display file description API, to provide a representational report with the field names printed on the data layout. The record formats are listed in the order they appear in the DDS source.

DSPF source member name (DSPF). . __________
Source file (SRCFILE). . __________ QDDSSRC
  Library . . . __________ *LIBL

Thanks to Randy Gevedon for suggesting this extension to the JCRANZP utility.



JCRANZO - Print OSPEC Layout Report

Reads your RPG4 source O specs to provide a representational report with the field names printed on the data layout. This is a very easy way to determine which fields are positioned where on the report.

RPG source member name (PGM). . __________
Source file (SRCFILE). . __________ QRPGLESRC
  Library . . . __________ *LIBL



JCRANZP - Print PRTF Field Report Layout

Reads your PRTF source to provide a representational report with the field name printed under the data positions..

PRTF source member name (PRTF). . __________
Source file (SRCFILE). . __________ QDDSSRC
  Library . . . __________ *LIBL



JCRLOG - Select Previously Executed Commands

Addresses the problem of having to press F9 repeatedly on the command line to cycle back through previously executed commands. This command executes an API to retrieve all commands executed from command line. (Never press F9 Again!). A subfile list is presented to execute or prompt each command. 11/13/2001 Thanks to Brignoli Luca for coding a change that shows only distinct commands regardless of the number of times a command has been executed.



JCRDUMP - Summarize RPG Dump Listings

Prints a list of all RPG programs that have generated a Dump spooled file and the count of how many times that program has dumped.

Selected date (JOB_DATE). . __________ MMDDYYYY, *AVAIL
Outq name (OUTQ). . QEZDEBUG_
  Library . . . *LIBL_____

This command uses several spooled file APIs to efficiently "read" through the selected outq and extract desired information from each spooled file.



JCRDQD - Display Data Queue Description

Displays Text, Data Length, Sequence, and Key Length (if any), current number of entries and maximum entries ever in the selected data queue.

Data Queue (DTAQ). . __________ Name
  Library . . . *LIBL_____



JCRDQE - Display Data Queue Entries

Displays the dataq entries in a subfile without touching or disturbing the entries. This is an important feature. A page navigational field is used to allow quick access to desired entry.

Data Queue (DTAQ). . __________ Name
  Library . . . *LIBL_____

05/08/2001: Rewrite using api QMHRDQM to retrieve queue entries as messages.
10/22/2001 Thanks to Dennis Lovelady for sharing a technique to use the user space as the receive variable.
11/13/2001: Thanks to Thomas Raddatz for coding some powerful enhancements like a hexadecimal display mode, and the ability to window over for longer entries.
06/26/2002 Thanks to Rory Hewitt for coding a toggle (F14) between keyed dataq keys and the data queue entries



JCRIND - Indicator List

Quick view of indicators used in the selected RPG3, RPGLE, CLP, PRTF or DSPF source code. Multiple members can be entered at one time to see cumulative indicator usage.

Source Member 1 . . __________ Name
Source File 1. . QRPGLESRC _
  Library . . *LIBL_____
Source Member 2 . . __________ Name
Source File 2. . QDDSSRC _
  Library . . *SRC1LIB___
Source Member 3 . . __________ Name
Source File 3. . QDDSSRC _
  Library . . *SRC1LIB___

Just for the record, I originally wrote the JCRIND display indicator utility in 1985 on a Wang VS80 in RPGII!. This is the oldest surviving utility on this page. 



JCROBJD - Expanded Object Descriptions

Work with a list of objects similar to the WRKOBJ command along with additional information about an object.  Excellent utility for cleanup as you can sort by last used date.

Object . . . __________ Name, generic*, *ALL
  Library . . . *LIBL_____
Object type . . . *ALL___

In the generated subfile, you may sort any column, like last used date, either ascending or descending by placing the cursor on the column and pressing a command key.


JCRFFD - File Field Descriptions

Displays,  prints, places in a outfile, or generates into RPGLE source the file-field level information for the selected file in the selected library.

File . __________ Name
  Library .  *LIBL_____
Output . *PRINT____ *, *PRINT, *OUTFILE, *SRC
Record Format . *FIRST____ Name, *FIRST
Sequence of presentation . *LOC______ *LOC, *NAME, *TEXT
Convert to unpacked format . *NO_______ *NO, *YES

09/16/2002 Thanks to suggestions by Ewart Desouza this utility now has full keylist information and a neat search through field name/text capability!


JCRNOTPOP - List Fields Not Populated

Prints of listing of fields that are not populated in the selected data file.

File (FILE). __________ Name
  Library .  *LIBL_____


This utility is very handy when searching for an unused field or as a testing tool to verify all fields in a file are being populated.


JCRJOBDL - Find Library on JOBD libl

Determine if a library is on the library list of any jobd.

Library on JOBD libl (LIBLE) . . . __________ Library Name

This is very helpful when wanting to cleanup or delete a library as you check to see if there will be any problems before hand. End result is a spooled file listing all JOBDs that use the selected library.



JCRJOBDQ - Find Job Queue on Jobd

Generates list of the Job Descriptions that use the selected Job Queue name. The Output option allows either print or display of the list.

Jobq name (JOBQ). _________
   Library name _______
Output *_______ *PRINT, *

Thanks to Marti Riera at AS/400 Recursos iSeries for submitting the code for this utility. I really like it when a person replies with something useful they have created based on one of these utilities! (in this case, Marti used an adaptation of the above JCRJOBDL utility).



JCRLKEY - Find Desired Access Path

Shows a subfile of all keys over the selected file and all data base relations (logicals) of that PF. You can select a field in any klist sequence or selected klist sequence to show the desired logical. Enter the file name (logical or physical) then the command will prompt to select the keys, then list every dependent file meeting your criteria. You can also select to exclude files with select/omit from your search.

File (FILE) . __________ Name
  Library . *LIBL_____



JCRPRTF - Generate external Print File DDS source

Generate a DDS external PRTF source member from the selected RPG4 program's O specs.

RPG source member (RPGMBR) . __________
Source file (QRPGSRCFIL) . QRPGLESRC_
  Library . *LIBL_____
DDS member to generate (PRTFMBR) . __________
Source file (PRTFSRCFIL) . QDDSSRC__
  Library . *LIBL_____
Use REFFLD field references (USEREFFLD) . *NO______ *NO, *YES

Please be aware the generated DDS will probably need some minor editing before the output perfectly matches the original O specs.  Things like array indexed name in O specs are not legal in DDS.



JCRPARTI - Retrieve Partition Info

This JCR command returns a message with system name, serial number, partition number (very important for licensing this days), OS version, User, and IP address.

This is a necessity when working on multiple systems/multiple partitions to help keep track of what system/partition you are on.



JCRPATTR - Crtprtf with attributes from existing PRTF

Extracts the creation attributes from an existing PRTF and applies them to the CRTPRTF of the selected source member.

PRTF source member name (SRCMBR) __________
Source file . . . . . QDDSSRC_____ QDDSSRC
  Library . . . __________
Create object in library . . . *SRCLIB_____ Name
Use Attributes from this Prtf . . *SRCMBR_____ Name
  Library . . . *SRCLIB_____



JCRNUMB - Number Source - Reformat /Free

Powerful free reformatting tool!  Updates your RPG source code with the structured logic statements numbered in the left margin. It will optionally highlight comments lines, code matching ENDxx opcodes, and reformat free code. I use this utility many times a day while working on code. With the addition of source code reformatting, it has superseded it's original usefulness into an absolutely essential tool for working with free format source!

RPG source member . __________
Source file . QRPGLESRC_
  Library . *LIBL_____
Highlight comment lines . *YES_____ *YES, *NO
Color structure markers . *YES_____ *YES, *NO
Matching ENDxx statements . *YES______ *YES, *NO
Reformat RPG free indentation . *YES__ *YES, *NO
Spaces for indent level . 3_



JCRSDENT - Show Source Indentation

Prints a CL or RPG source listing with structured programming operations indented for improved readability.

Source member (SRCMBR) . __________ Name
Source file (SRCFILE) . QCLSRC____
  Library . *LIBL_____



JCRRTVRPG - Retrieve RPGLE Source

Retrieves the source member from any V5 or V6 RPGLE object compiled with DBGVIEW *LIST or *ALL. Note There are some quirks with the IBM dump so please read the help text with this command.

Object compiled *LIST or *ALL __________ Name
  Library . *LIBL_____
RPGLE member to generate __________ Name
Source file (SRCFILE) . QRPGLESRC_
  Library . *LIBL_____



JCRBND - List Procedure Names

Outputs a list of procedures/symbols that are exported by a selected *BNDDIR, *SRVPGM or *MODULE.

Binding Object . . . __________ Name, generic*, *ALL
  Library . . . ________
Object Type . . . *BNDDIR___ *BNDDIR, *SRVPGM, *MODULE
Output *PRINT___ *PRINT, *OUTFILE, *



JCRJOB - Work With Selected Job List

Loads a subfile with a list of jobs that meet your selection criteria. From the subfile, you can select various options to perform.

Job Name . *ALL______ Name, generic*, *ALL
  User . *CURRENT__ Name, generic*, *ALL
  Number . *ALL______ Character value
Status of jobs . *ACTIVE___ *ALL, *ACTIVE, *JOBQ, *OUTQ

This command also includes a nifty job file I/O monitor.. You can sort the open files by number of I/Os or file name.
07/22/2002 Use new v5 api QDMLOPNF to list open files.



JCRSPLF - List Spool Files with Options

Loads a subfile with a list of spooled files that meet your selection criteria. From the subfile, you can select various options to perform. Added a API driven dupicate spooled file option. Creates a new spooled file from selected spooled file and lets you override the creation attributes, like page rotation and outq.

Outq name (OUTQ) . *ALL______ Name, *ALL
  Library . . . *LIBL_____
User . *CURRENT__ Name, *CURRENT, *ALL
Form Type . *ALL______ Name, *STD, *ALL
User Data . *ALL______ Name, *ALL



JCRDTAARA - List Data Area Values and Rollover Distances

Lists selected or *all *DECimal type data areas in selected library. It shows the current value in the dtaara and how many more (whole number integer) values are available before the data area rolls back over to zero. Also included is the creation date of the dtaara, last date used, and number of days used.

Data Area Name . . . __________ Name, generic*, *ALL
  Library . . . *LIBL_____

If you use dtaaras to control things like next order number, next package number, etc.. It can be extremely useful to know what value is in these data areas and how many more values are available before the data area rolls back over to zero.



JCRLSRC - List Program Source/Modules

Prints a list of the selected program objects showing the source code lib/file/member that was used to compile the program. If the program was created with modules, then all modules that are bound in the program are listed. Also included is the creation date of the object, last date used, and number of days used.

Program . . . __________ Name, generic*, *ALL
  Library . . . ________
Program Type . . . *ALL___ *ALL, *RPGLE, *CLP, *RPG3


Thanks to Pete Priefer for suggesting this very useful utility.



JCROLCK - List Jobs with Object Locks

Displays a subfile of jobs with a lock on the selected object. The big advantage is ability to SNDBRKMSG to an offending user. The ENDJOB option defaults to *IMMED as opposed to the whimpy *CNTRLD option of the WRKJCROLCK command.

Object . . . __________ Name
  Library . . . *LIBL_____
Object type . . . *ALL___



JCRCALL - Command Prompt Entry Parms

Generates/prompts a command definition created from the entry parm field names and attributes required by selected program. The generated command designates the selected program as the command processing program, so you can enter the parm values and execute the program if you wish.

Program to call . . . __________ Name
  Library . . . *LIBL_____

This utility is very helpful for easy viewing entry parm lists. It will process CLP parms, RPG4 *Entry PLISTS, and RPG4 MAIN procedures.



JCRRECRT - Recreate CMD using existing values

Uses an API to retrieve the original parameters used to define the selected command. You then have a CRTCMD (Create Command) prompt with the creation parameters already filled in.

Command (CMD). . __________ Name
  Library . . . *LIBL_____



JCRRFLD - Field Attributes in RPG Source

Display a subfile of all fields, field attributes and where-from file names used in selected RPG program.

RPG source member (PGM) . __________ Name
Source file (SRCFILE) . QRPGLESRC_
  Library . *LIBL_____



JCRRFIL - Record Format / File Name Xref

Display a list of all Files / Record Formats / Record Format Renames / and Based-On-Physicals used in a selected RPG source. This is great when set up as a PDM option! If you only get one command from this page, consider getting this one.

RPG source member (PGM) . __________ Name
Source file (SRCFILE) . QRPGLESRC_
  Library . *LIBL_____



JCR4MAX - Maximize Conversion to RPG4

Designed to run immediately after the CVTRPGSRC command.   This utility does many things I feel the CVTRPGSRC command should have done.

RPG source member (PGM) . __________ Name
Source file (SRCFILE) . QRPGLESRC_
  Library . *LIBL_____
Case (Up/Low) for source . *UPOP_LOWALL_ *NOACTIPON, *UPALL, *LOWALL

NOTE Attribute testing of each field is done to make sure only valid conversions take place.

Conversions include

Be sure and read the help text for this command. There is an editing step involved in positioning the generated D specs in the code.



JCRPROTO - Generate Prototyped V7 RPGLE

Reads your selected RPG4 source and generates a new RPG4 source member with the *entry and calls converted to DCL-* procedure interface and CALLP prototypes. All call opcodes are replaced with CALLP, all parm opcodes are replaced with prototype syntax.

RPG source member (RPG4MBR) . __________
Source file (RPG4SFIL) . QRPGLESRC_
  Library . *LIBL_____
New source member to generate(PROTMBR). __________
Source file . QRPGLESRC_
  Library (PROTSFL) . *LIBL_____

Note After conversion, 1) you may need to change some of the prototype definitions due to DSPF files returning all fields defined as signed. 2) if fields used as parms were defined in the calc specs, then you will need to define them in D specs. 3) if entry parm field was defined on a D spec, then the D spec will have to be deleted.



JCRFREESS - Show RPG fixed and converted free format source side-by-side

Shows original RPG4 fixed format calc specs on the left side of screen and what the code would look like in free format on the right side.

Many opcodes have no free equivalent so ????????? beside an opcode means that code would have to be re-written. You will see way too many of these as they dropped many critical opcodes.

A summary page is produced at the bottom of each report showing each opcode that could not be converted and a count of the number of times it was used in the code.

RPG member name (SRCMBR) . __________ Name
Source file (SRCFILE) . QRPGLESRC_
  Library . *LIBL_____



JCR5FREE - Generate free Calc Specs from v4 RPGLE

Reads your selected RPG4 source and generates a new RPG source member with the fixed format C specs converted to free source.

RPG4 source member (RPG4MBR) . __________
Source file (RPG4SFIL) . QRPGLESRC_
  Library . *LIBL_____
Free source member to generate. __________
Source file . QRPGLESRC_
  Library . *LIBL_____

This utility will take v4 source that has been PURPOSELY written to convert into free format, then convert the calc specs into that format.

I would strongly recommend getting the JCRFREESS utility and print a listing of what will not convert. Then fix that in the original program before using this utility. The document A Path to /Free on the main page should be considered required reading before using this utility.



JCRFD - Retrieve File Description

Provides a quick method for viewing the most often requested information about a data file. Options are available to Display Data Base Relations, View/Remove members, List record formats, and view Trigger information.

File . . . . __________ Name
  Library . . . . *LIBL_____
Member . . . . *FIRST____ Name, *FIRST

The Remove member option is very handy as it will remove same named members from all logicals files built over selected physical.



JCRSMLT - Scan Multiple Files / Strings

Search up to ten character strings in selected members of up to nine source physical files. The results of the search are then printed or loaded into outfile.

8/23/01 Major new functionality with the If-Member-Contains parm!
 *ALL - member must contain ALL selected search strings. (AND relationship)
 *ANY - member contains ANY one of the search strings (OR relationship)
 *NONE - member contains NONE of the search strings
Thanks to Thomas Raddatz for suggesting this powerful idea.

Find 'string'(s) . _________________________
   + For more values . _________________________
If member contains . *ANY___ *ANY, *ALL, *NONE,
Source file(s) .
  File . . . .   __________ Name, F4 prompt predefined lists
   Library . . . .   *LIBL_____
    Member . . . .   *ALL_____ *ALL, generic*
    Member Type . . . .   *ALL_____ *ALL,RPGLE,CLP,DSPF,etc..
     + For more values .   _
List occurrences in each mbr *FIRST____ *FIRST, *ALL
Scan Comment Lines *NO______ *NO, *YES
Output *PRINT___ *PRINT, *OUTFILE, *

04/11/2001: Thanks to Gerald Magnuson for his idea on predefining a list of files as a single keyword.
08/16/01 Thanks to Craig Ficik for his suggestion to optionally list all occurrences of scan string in the member and to optionally allow outfile.
10/30/01 Thanks to Carlos Kozuszko for his suggestion to add member type selection.



JCRFSET - Scan File Set Where Used

Enter a selected data file and up to nine source physical files. The utility retrieves all PF and LF file names associated with the selected data file and scans for those names in the selected source members.

The output can either be an informative report or an outfile. Very handy when tracking down all source that may need recompiling due to a file format change.

File name ______
   Library name *LIBL__
Source file(s) .
  File . . . .   __________ Name, F4 prompt predefined lists
   Library . . . .   *LIBL_____
    Member . . . .   *ALL_____ *ALL, generic*
    Member Type . . . .   *ALL_____ *ALL,RPGLE,CLP,RPG, SQLRPGLE,etc..
     + For more values .   _
Output *PRINT___ *PRINT, *OUTFILE, *

Note: (If you have previously installed JCRSMLT utility and have added records to JCRSMLTCHF, please copy out and replace after update.



JCRSSQL - Scan Interactive SQL sessions

Search through past STRSQL sessions! then displays a subfile of SQL statements that meet your selection criteria. You can also search through someone else's SQL sessions and look at those statements as well! The utility allows for execution of a selected sql statement.*

User ID *CURRENT____

David George contributed the code for the dmpsysobj command and the idea for allowing sql executions. Martin Rowe contributed the cool scan progress meter so you can see scan percentage completed and the EXCSQL interface. Thomas Raddatz contributed the sql execution program that uses SQL CLI direct DB2 interface coding. See the Links page to visit their AS/400 web sites.



JCRNETFF - Send Multiple Network Files/Multiple To Userids

Send up to 10 files to 5 remote userids.

From Library . *libl_______
Files . __________
   + For more values . __________
User IDs...............
User ID . ________
Remote Address . ________
   + For more values . _

Back by request, it is a serious RPG-only rewrite of a 1992 CLP utility. This reincarnation uses advanced system APIs for validity checking, pointer arithmetic for list processing, and the extproc C function 'system' to send the netfiles. It is now a brutally efficient method to send multiple network files.



JCRNETFM - Send Multiple Network Members/Multiple To Userids

Send multiple members, selectable by specifying *ALL, *FIRST, generic* or by member name to 5 remote userids. This is a huge improvement over the stock sndnetf command.

File name QRPGLESRC __
   Library name *LIBL__
Members . __________ *FIRST,*ALL,generic*, name
   + For more values . __________
User IDs...............
User ID . ________
Remote Address . ________
   + For more values . _



JCRNETQ - Send Network Outq

Performs a SNDNETSPLF command for every spooled file in a selected outq. The spooled files are all sent to the selected userid and address.

Outq name (OUTQ) . __________ Name
  Library . . . *LIBL_____
User ID (TOUSRID) . __________ Name
Address (SYSTEM) . __________ Name



JCRUFIND - Find String in User Spaces

Searches for string(s) in selected user spaces in selected library, then displays list of user space names with selected string.

User Space . . __________ Name, generic*, *ALL
  Library . . . *LIBL_____
Scan For String. __________ Name


JCRUSPACE - Show User Space Contents

Uses a whole bunch of pointers to allow you to scroll through a selected user space. You can Search for text and Position To a particular offest.

User Space . . __________ Name
  Library . . . *LIBL_____
Scan For String (STRING1) . ________________________________

12/02/2002 Major enchantments of Hex display and improved search algorithm coded by Bill Reger, creator of WRKDBF, Work Data Base File.



XMLGEN - Generate XML download members

This utility offers a truly convenient way to package source code and object creation instructions of all objects required for a utility or application. Output is a well-formed, valid XML document with the Document Type Definition and XML parser/installer program embedded in the text.

Script member name . __________
Script source file . QXMLGENS__
  Library . . . *LIBL_____
Source file to put XML member . QXML______
  Library . . . *LIBL_____

This methodology was designed, with intellectual input from Martin Rowe (DBG/400) and David George (400times.Uk), to become a serious, standard method for transmitting source code and applications. A short overview of the process is available here. XMLGEN was also published in the May 2002 issue of Iseries News.



XMLPREVIEW - Preview XML before install

This utility offers you three very important functions. 1) allows you to preview the member names about to be installed 2) allows you to preview all commands that will be executed during the course of the install and 3) makes installation of any other utility or program from this page a very simple process.

This utility reads the source member you uploaded to your 400. It runs a subset of the installer/parser to load a subfile with information from the uploaded member. After you have reviewed the data, you have the option to exit without install or continue with install.

Uploaded member name . __________
Uploaded source file . __________
  Library . . . *LIBL_____

Personally, this would be the first utility I downloaded.



JCRIFS - Install From IFS Path

This utility is cool if you use the IFS drive for uploading things. Simply unzip any program on this page to your IFS directory and execute this command! It will list the directory entries in a subfile, then prompt the XMLPREVIEW utility and install directly from your IFS directory! You don't even have to load anything to your 400 to get an install! Truly the easiest install method on the web.

IFS Path Name . JCR________________________________________

Note: XMLPREVIEW (see above) must be installed to use the install from IFS functionality.



XMLSVIEW - View XMLGEN script member in subfile

This utility offers an easy way to review script members you have defined for the XMLGEN utility. It reads the script member and presents all the values for xmlgenmbr commands into a single subfile record. The xmlgencmd records are parsed into as many subfile records as required.

Script member name . __________
Script source file . QXMLGENS__
  Library . . . *LIBL_____



XMLSRCFIL - All source file mbrs to single XML mbr

This utility places all members from a selected source file into a single well-formed XML mbr complete with all the information required to recreate your source members on another system. Note XMLGEN utility a prerequisite.

Input Source File name . __________
  Library . . . *LIBL_____
Source file for XML out member . __________
Source lib for XML out member _________

There is a one-record-less-than-a-million restriction on the size of the output file.



©  1985-2016  Craig Rutledge.  


If you have questions about any utility command or how to install a utility on your iSeries, email me .
Back Back to JCRCMDS.

Last modified May 15 2019.