Miscellaneous Directory
Directory .ZIPThese items don't fit anywhere else, but I reference them in other items so I had to upload these too, or they're simply objects that others might find useful. Mostly they're some general purpose commands and any related command-processing programs.
Out of these, the one I use the most is RTNLEN. This has been a real time-saver. Not much to it; all it does is accept an input string, or character variable, and return the length, ignoring trailing spaces. But as you can see from the CPP, the counting of significant characters is left up to i5/OS. The CMD pretty much just asks "How long is this?" and the CPP returns the answer from i5/OS.
I'm also uploading a few odd REXX procedures in the REXX_Stuff directory that don't fit anywhere, so I'm referencing them here. DOCTOR is a REXX version of a very early Basic version of ELIZA -- a therapist program. I put this version together at least 15 years ago, mostly to learn more about REXX. I don't have time to make it more "intelligent", but maybe others can. If nothing else, it's fun to see it running on System i. XD is a trivial (but very handy) function for hex <-> decimal conversions. Make it the REXX CPP for a XD command or the target of a XD PDM option to have it close.
Please read the @GENERAL DISCLAIMER document for any items you should be aware of if you download any of these items.
CLPs
EXCCMDMBR -- Execute CL Member:
This program is the CPP for EXCCMDMBR. The program reads commands from a CL (or CLP) source member and executes the commands in sequence or checks them for valid syntax.RTNLEN -- Return Length:
This program is the CPP for RTNLEN. Its only action is to extract the length attribute from the input parm and return it to the calling program.
CMDs
CLSCAN -- Scan for String Pattern (QCLSCAN):
The command definition object source for QCLSCAN. This command accepts parameters defining search string and pattern and passes them to the well known QCLSCAN API.EXCCMDMBR -- Execute CL Member:
The command definition object source for EXCCMDMBR. This command accepts parameters naming a source member and error options and passes them to EXCCMDMBR. The error options determine the action to take if errors occur when one of the commands is executed.OFFSETDAT -- Offset a Date:
The command definition object source for OFFSETDAT. This command accepts parameters specifying an offset direction, the number of years, months and/or days to offset, the date to offset from and a returned date and passes them to OFFSETDAT. The offset direction determines whether the offset is to a future or past date. The direction can be either *ADD to offset to a future date or *SUB to offset to a past date.PRCCMD -- Process Commands (QCAPCMD):
The command definition object source for QCAPCMD. This command accepts parameters specifying a command to execute. For most uses, the QCAPCMD API is interchangeable with the older QCMDEXC API, but QCAPCMD has advantages. I've coded a variation of the options control block to illustrate.When used with OCB(*DFT), the command works more or less exactly like QCMDEXC. When used with OCB(*CHECK), the command works similar to QCMDCHK but with a couple additions:
Use the special-values I provided or build an OCB() value of your own.
- Limited user checking is performed.
- Prompting for missing required parameters is performed.
- If the System/36 environment is active and the commands are System/36 commands, the System/36 environment runs the commands.
RTNLEN -- Return Length:
The command definition object source for RTNLEN. This command accepts a character string (or character variable) up to 3000 characters in length and returns the significant length, ignoring trailing blanks.
RPGLEs
OFFSETDAT -- Offset a Date:
This program is the CPP for OFFSETDAT. The program adds or subtracts a supplied number of years, months and/or days to or from a supplied starting date and returns the calculated new date.This is ILE RPG and the parameter passing is through a prototyped interface for a main procedure. The date and offset values come in, the date duration addition/subtraction is done and the calculated date is returned.
Because the command shell automatically enforces such things as a valid date for the starting date and the range of values for years, months and days, only limited checking for errors is done within the program.
- Note:
- The program works internally as written only with the *CYMD0 date format. Therefore, the returned date is formatted as CYYMMDD with no separators.