Initial Add

This commit is contained in:
SJLennon
2021-06-25 15:50:29 -04:00
parent b950de21dd
commit fd78cee53c
16 changed files with 245 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

+8
View File
@@ -0,0 +1,8 @@
CMD PROMPT('Query a file')
/* CPP is QRYC */
PARM KWD(FILE) TYPE(QUAL) PROMPT('File Name')
QUAL: QUAL TYPE(*NAME) MIN(1)
QUAL TYPE(*NAME) DFT(*LIBL) SPCVAL((*LIBL +
*CURLIB)) PROMPT('Library')
PARM KWD(SELECT) TYPE(*CHAR) LEN(1) DFT(N) +
PROMPT('Select? (Y/N')
+23
View File
@@ -0,0 +1,23 @@
/* Gives a quick and dirty look at the contents of a file. */
/* Front end to "RUNQRY *NONE filename" to save me entering *NONE. */
/* (I'm lazy...) */
/* You can also enter selection criteria if you so desire. */
/* Use the QRY command to invoke this program */
PGM PARM(&PI_FILE &PI_SEL)
DCL VAR(&PI_FILE) TYPE(*CHAR) LEN(20)
DCL VAR(&PI_SEL) TYPE(*CHAR) LEN(1)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCL VAR(&SEL) TYPE(*CHAR) LEN(4) VALUE(*NO)
CHGVAR VAR(&FILE) VALUE(%SST(&PI_FILE 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&PI_FILE 11 10))
IF COND(&PI_SEL = 'Y') THEN(CHGVAR VAR(&SEL) +
VALUE(*YES))
RUNQRY QRY(*NONE) QRYFILE((&LIB/&FILE)) RCDSLT(&SEL)
ENDPGM
+8
View File
@@ -0,0 +1,8 @@
RC: CMD PROMPT('Display Record Count')
/* CPP is RCC. */
PARM KWD(FILE) TYPE(Q1) PROMPT('File Name')
PARM KWD(MBR) TYPE(*NAME) LEN(10) DFT(*FIRST) +
SPCVAL((*FIRST)) MIN(0) PROMPT('Member')
Q1: QUAL TYPE(*NAME) LEN(10) MIN(1)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB)) PROMPT('Library')
+82
View File
@@ -0,0 +1,82 @@
RCC: +
PGM PARM(&PFILE &PMBR)
/* This program displays the record count in a file and allows a */
/* a refresh with F5. A member can be specified but defaults to */
/* *FIRST. */
/* */
/* It's easier to read than the output of DSPFD. */
/* */
/* Use the RC command to invoke this program */
/* 01/01/98 LENNON. Original Writing */
/* Input parameters */
DCL VAR(&PFILE) TYPE(*CHAR) LEN(20) /* file/lib */
DCL VAR(&PMBR) TYPE(*CHAR) LEN(10) /* member */
/* Variables used in this program */
DCLF FILE(RCDD)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
DCL VAR(&MBR) TYPE(*CHAR) LEN(10)
DCL VAR(&RECAN) TYPE(*DEC) LEN(10 0) /* Active # */
DCL VAR(&RECDN) TYPE(*DEC) LEN(10 0) /* Deleted # */
DCL VAR(&RECTN) TYPE(*DEC) LEN(10 0) /* Total # */
/*DCL VAR(&PCT) TYPE(*DEC) LEN(10 0)*//* % deleted */
/* Error Handling Variables */
DCL VAR(&E_MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&E_MSGF) TYPE(*CHAR) LEN(10)
DCL VAR(&E_MSGFLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&E_MSGDTA) TYPE(*CHAR) LEN(100)
/* Catch unmonitored errors */
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))
/* Split out file and library */
CHGVAR VAR(&FILE) VALUE(%SST(&PFILE 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&PFILE 11 10))
CHGVAR VAR(&MBR) VALUE(&PMBR)
/* Loop displaying record count until exit with F3/F12 or enter */
LOOP: +
RTVMBRD FILE(&LIB/&FILE) MBR(&PMBR) RTNLIB(&LIB) RTNMBR(&MBR) +
NBRCURRCD(&RECAN) NBRDLTRCD(&RECDN)
MONMSG MSGID(CPF3019) EXEC(DO)
CHGVAR VAR(&MBR) VALUE('No Members')
ENDDO
CHGVAR VAR(&RECTN) VALUE(&RECAN + &RECDN)
CHGVAR VAR(&RECA) VALUE(&RECAN)
CHGVAR VAR(&RECD) VALUE(&RECDN)
CHGVAR VAR(&RECT) VALUE(&RECTN)
/* Calculate Percent deleted and hightlight on screen if high */
CHGVAR VAR(&IN41) VALUE('0') /* clear highlight */
CHGVAR VAR(&PCT) VALUE(0) /* zero the pct */
IF COND(&RECTN > 0) THEN(DO)
CHGVAR VAR(&PCT) VALUE(&RECDN / &RECTN * 100)
IF COND(&PCT > 10) THEN(DO)
CHGVAR VAR(&IN41) VALUE('1') /* highlight */
ENDDO
ENDDO
SNDRCVF RCDFMT(RCD)
CHGVAR VAR(&IN40) VALUE('1') /* PUTOVR on */
IF COND(&IN03 *OR &IN12) THEN(GOTO CMDLBL(ENDPGM))
IF COND(&IN05) THEN(GOTO CMDLBL(LOOP))
/* End of program */
RETURN
/* Error handler - resend any trapped escape message */
ERROR: +
RCVMSG MSGTYPE(*LAST) MSGDTA(&E_MSGDTA) MSGID(&E_MSGID) +
MSGF(&E_MSGF) MSGFLIB(&E_MSGFLIB)
MONMSG MSGID(CPF0000) /* Just in case */
SNDPGMMSG MSGID(&E_MSGID) MSGF(&E_MSGFLIB/&E_MSGF) +
MSGDTA(&E_MSGDTA) MSGTYPE(*ESCAPE)
MONMSG MSGID(CPF0000) /* Just in case */
ENDPGM: +
ENDPGM
+55
View File
@@ -0,0 +1,55 @@
A*===============================================================
A* Window for the RC command to display file record counts.
A*===============================================================
A* CRTDSPF FILE(RCDD) RSTDSP(*YES)
A*==============================================================
A DSPSIZ(24 80 *DS3 -
A 27 132 *DS4)
A PRINT
A*===============================================================
A R RCD
A 40 PUTOVR
A TEXT('Screen Header')
A WINDOW(*DFT 8 32)
A OVERLAY
A CA12(12)
A CA03(03)
A CA05(05)
A 1 1SYSNAME
A 1 12DATE
A EDTCDE(Y)
A 1 23TIME
A 2 1'Library '
A DSPATR(UL)
A 2 12'File '
A DSPATR(UL)
A 2 23'Member '
A DSPATR(UL)
A LIB 10A O 3 1DSPATR(HI)
A FILE 10A O 3 12DSPATR(HI)
A MBR 10A O 3 23DSPATR(HI)
A RECT 10 0O 4 1EDTCDE(1)
A OVRDTA
A 4 15'Total Records'
A RECA 10 0O 5 1EDTCDE(1)
A OVRDTA
A 5 15'Active'
A RECD 10 0 6 1EDTCDE(1)
A OVRDTA
A 41 OVRATR
A 41 COLOR(RED)
A 6 15'Deleted'
A 41 OVRATR
A 41 COLOR(RED)
A PCT 4Y 1 6 26EDTCDE(3)
A 41 COLOR(RED)
A 6 32'%'
A 41 COLOR(RED)
A 7 1'F5=Refresh F3/F12/Enter=Exit'
A*===============================================================
A*=== Dummy Record - Assume =====================================
A*
A R DUMMY
A ASSUME
A 1 2' '
+69
View File
@@ -0,0 +1,69 @@
# Developer Utilities
These are personal utility commands that I wrote somewhere in my career, to make my life easier. Maybe they will make your life easier.
And you can see some examples of simple command definitions.
## QRY Query (List) File Contents
This just a quick and dirty shorthand way to look at the contents of a file. You probably know that you can list the contents of a file by `RUNQRY *NONE filename`. I got tried of typing the *NONE and instead wanted to simply enter `QRY filename`. Hence this command.
QRY invokes RUNQRY internally. RUNQRY is the runtime component of the old Query/400 product. It you understand Query/400 and you really want to, you can tell QRY to open up for entry of selection criteria.
![QRY Prompter](Images/QRY_1.jpg)
### Typical QRY, file in library list
![Typical QRY](Images/QRY_2.jpg)
### QRY With Selection
![Qry with Selection](Images/QRY_3.jpg)
This opens up the RUNQRY selection dialog:
![QRY selection dialog](Images/QRY_3A.jpg)
With results like this:
![QRY results](Images/QRY_3B.jpg)
#### QRY
The command source
#### QRYC
The CLP command processing program
## RC - Display File Record Count
This provides a popup window showing the number of records in a file.
![RC example display 1](Images/RC_1A.jpg)
It also shows the number of deleted records. If there are greater than 10% deleted this is highlighted:
![RC example Display 2](Images/RC_1B.jpg)
You can press F5 and watch any add or delete activity on the file.
RC defaults to the *FIRST member, but you can specify a member:
![RC Prompt](Images/RC_1B.jpg)
I also have a PDM User-Defined RC option: `RC FILE(&O/&N)`. So in PDM I can do:
![RC PDM 1](Images/RC_3A.jpg)
which gives this:
![RC PDM 2](Images/RC_3B.jpg)
### RC
The command source
### RCC
The CLLE source of the command processing program
### RCDD
The display file for the window