Thursday, March 15, 2007

Exit Point and Exit Program

AS400/iSeries command: WRKREGINF

The Work with Registration Information display shows a list of exit points. You can use this list to display information about an exit point or to work with exit programs associated with an exit point.

The list of exit points is based on the values you entered for the exit point and format parameters of the Work with Registration Information (WRKREGINF) command.

Output of WRKREGINF:
Exit Point
Opt Point Format Registered Text
QIBM_QCA_CHG_COMMAND CHGC0100 *YES Change command exit programs
QIBM_QCA_RTV_COMMAND RTVC0100 *YES Retrieve command exit program
QIBM_QCST_ADMDMN ADMN0100 *YES Cluster administrative domain
QIBM_QDB_CLOSE DBCL0100 *YES Close Database File Exit Prog
QIBM_QDB_OPEN DBOP0100 *YES Open Database File Exit Progr
QIBM_QDC_VRYEXIT PROF0100 *YES Vary Configuration (VRYCFG) o
QIBM_QDC_VRYEXIT PRON0100 *YES Vary Configuration (VRYCFG) o
QIBM_QDC_VRYEXIT PSOF0200 *YES Vary Configuration (VRYCFG) o
QIBM_QDC_VRYEXIT PSON0200 *YES Vary configuration (VRYCFG) o
QIBM_QHQ_DTAQ DTAQ0100 *YES Original Data Queue Server
QIBM_QIMG_TRANSFORMS XFRM0100 *YES Exit Point for Image Print Tr

Associated commands:

1. Add Exit Program: ADDEXITPGM

2. Remove Exit Program: RMVEXITPGM

Wednesday, March 07, 2007

SQL ORDER BY mixing 2 columns

SELECT retrn, speco, grpdc, Case When grpdc <> ' ' Then grpdc Else speco End As column4 FROM mrcdct15 ORDER BY 4

The records will be sorted by using values from both speco and grpdc columns.

Note this is only used to demonstrate the use of CASE WHEN … THEN and the use of merging 2 columns. This maybe really useful when one needs to join 2 files and sort by columns in 2 files:

File1 colx File2 coly

1. A
2. A
3. C
4. D
5. D B

And you want the records to sorted as :

1, 2, 5, 3, 4