Article

DSPASP

Richard Matthews

 
    100 PGM                                                                                                             01/04/03
    200 /* ***************************************************************** */                                         17/04/03
    300 /* This job uses API QYASPOL to determine the current ASP Threshold. */                                         17/04/03
    400 /* If this is being run Interactively, the details will be displayed */                                         17/04/03
    500 /* on the users screen, prior to being written to file ASPTHRESH2,   */                                         17/04/03
    600 /* via Query ASPTHRESH.                                              */                                         17/04/03
    700 /*                                                                   */                                         17/04/03
    800 /* rpm 170403                                                        */                                         17/04/03
    900 /* ***************************************************************** */                                         17/04/03
   1000                                                                                                                 17/04/03
   1100                                                                                                                 17/04/03
   1200 /* API parameters  */                                                                                           14/04/03
   1300              DCL        VAR(&RCVR) TYPE(*CHAR) LEN(116)                                                         03/04/03
   1400              DCL        VAR(&LEN) TYPE(*CHAR) LEN(4)                                                            01/04/03
   1500              DCL        VAR(&LIST) TYPE(*CHAR) LEN(80)                                                          01/04/03
   1600              DCL        VAR(&NUMR) TYPE(*CHAR) LEN(4)                                                           01/04/03
   1700              DCL        VAR(&NUMF) TYPE(*CHAR) LEN(4)                                                           01/04/03
   1800              DCL        VAR(&FLTR) TYPE(*CHAR) LEN(16)                                                          01/04/03
   1900              DCL        VAR(&FMT) TYPE(*CHAR) LEN(8) VALUE('YASP0200')                                          01/04/03
   2000              DCL        VAR(&ERR) TYPE(*CHAR) LEN(80)                                                           01/04/03
   2100              DCL        VAR(&FSIZE) TYPE(*CHAR) LEN(4)                                                          01/04/03
   2200              DCL        VAR(&FKEY) TYPE(*CHAR) LEN(4)                                                           01/04/03
   2300              DCL        VAR(&FFDSIZE) TYPE(*CHAR) LEN(4)                                                        01/04/03
   2400              DCL        VAR(&FDATA) TYPE(*CHAR) LEN(4)                                                          01/04/03
   2500                                                                                                                 01/04/03
   2600 /* Terminal Id  */                                                                                              14/04/03
   2700              DCL        VAR(&TERMINAL) TYPE(*CHAR) LEN(10)                                                      01/04/03
   2800              DCL        VAR(&TYPE) TYPE(*CHAR) LEN(1)                                                           17/04/03
   2900                                                                                                                 17/04/03
   3000                                                                                                                 01/04/03
   3100 /* ASP No  */                                                                                                   14/04/03
   3200              DCL        VAR(&APIASPNO) TYPE(*DEC) LEN(2 0)                                                      14/04/03
   3300              DCL        VAR(&ASPNO) TYPE(*CHAR) LEN(2)                                                          14/04/03
   3400                                                                                                                 14/04/03
   3500 /* ASP Threshold  */                                                                                            14/04/03
   3600              DCL        VAR(&APIASPTHLD) TYPE(*DEC) LEN(2 0)                                                    14/04/03
   3700              DCL        VAR(&ASPTHLD) TYPE(*CHAR) LEN(2)                                                        14/04/03
   3800                                                                                                                 14/04/03
   3900 /* ASP %used  */                                                                                                14/04/03
   4000              DCL        VAR(&APIASPUSE) TYPE(*CHAR) LEN(5)                                                      14/04/03
   4100              DCL        VAR(&PERUSED) TYPE(*DEC) LEN(5 2)                                                       14/04/03
   4200                                                                                                                 14/04/03
   4300 /* ASP Total  */                                                                                                14/04/03
   4400              DCL        VAR(&APIASPTOT) TYPE(*DEC) LEN(11 0)                                                    14/04/03
   4500              DCL        VAR(&ASPTOT) TYPE(*CHAR) LEN(11)                                                        14/04/03
   4600                                                                                                                 14/04/03
   4700 /* ASP Available  */                                                                                            14/04/03
   4800              DCL        VAR(&APIASPAVL) TYPE(*DEC) LEN(11 0)                                                    14/04/03
   4900                                                                                                                 14/04/03
   5000              RTVJOBA    JOB(&TERMINAL) TYPE(&TYPE)                                                              17/04/03
   5100                                                                                                                 01/04/03
   5200  CREATEFILE: CRTPF      FILE(QGPL/ASPTHRESH) RCDLEN(132)                                                        16/04/03
   5300              MONMSG     MSGID(CPF0000) EXEC(CLRPFM +                                                            16/04/03
   5400                           FILE(QGPL/ASPTHRESH))                                                                 16/04/03
   5500                                                                                                                 16/04/03
   5600  CRTDTAARA:  CRTDTAARA  DTAARA(QGPL/ASPTHRESH) TYPE(*CHAR) LEN(2) +                                             16/04/03
   5700                           TEXT('ASP Threshold')                                                                 16/04/03
   5800              MONMSG     MSGID(CPF0000) EXEC(CHGDTAARA +                                                         16/04/03
   5900                           DTAARA(QGPL/ASPTHRESH) VALUE('  '))                                                   16/04/03
   6000                                                                                                                 16/04/03
   6100              CHGVAR     VAR(%BIN(&FSIZE 1 4)) VALUE(16)                                                         01/04/03
   6200              CHGVAR     VAR(%BIN(&FKEY 1 4)) VALUE(1)                                                           17/04/03
   6300              CHGVAR     VAR(%BIN(&FFDSIZE 1 4)) VALUE(4)                                                        01/04/03
   6400              CHGVAR     VAR(%BIN(&FDATA 1 4)) VALUE(-1)                                                         01/04/03
   6500                                                                                                                 01/04/03
   6600              CHGVAR     VAR(&FLTR) VALUE(&FSIZE *CAT &FKEY *CAT +                                               01/04/03
   6700                           &FFDSIZE *CAT &FDATA)                                                                 01/04/03
   6800                                                                                                                 01/04/03
   6900              CHGVAR     VAR(%BIN(&ERR 1 4)) VALUE(80)                                                           01/04/03
   7000              CHGVAR     VAR(%BIN(&ERR 5 4)) VALUE(0)                                                            01/04/03
   7100              CHGVAR     VAR(%SST(&ERR 9 72)) VALUE(' ')                                                         01/04/03
   7200                                                                                                                 01/04/03
   7300              CHGVAR     VAR(%BIN(&LEN 1 4)) VALUE(116)                                                          14/04/03
   7400              CHGVAR     VAR(%BIN(&NUMF 1 4)) VALUE(1)                                                           01/04/03
   7500              CHGVAR     VAR(%BIN(&NUMR 1 4)) VALUE(1)                                                           14/04/03
   7600                                                                                                                 01/04/03
   7700 /* Call API QYASPOL  */                                                                                         14/04/03
   7800              CALL       PGM(QGY/QYASPOL) PARM(&RCVR &LEN &LIST &NUMR +                                          01/04/03
   7900                           &NUMF &FLTR &FMT &ERR)                                                                01/04/03
   8000                                                                                                                 01/04/03
   8100 /* Parse info received from API  */                                                                             14/04/03
   8200              CHGVAR     VAR(&APIASPNO) VALUE(%BIN(&RCVR 3 2))                                                   14/04/03
   8300                                                                                                                 14/04/03
   8400              CHGVAR     VAR(&APIASPTOT) VALUE(%BIN(&RCVR 9 4))                                                  14/04/03
   8500              CHGVAR     VAR(&APIASPAVL) VALUE(%BIN(&RCVR 13 4))                                                 14/04/03
   8600                                                                                                                 14/04/03
   8700              CHGVAR     VAR(&APIASPTHLD) VALUE(%bin(&RCVR 63 2))                                                14/04/03
   8800                                                                                                                 14/04/03
   8900                                                                                                                 14/04/03
   9000 /* Calculate ASP %used  */                                                                                      14/04/03
   9100              CHGVAR     VAR(&PERUSED) VALUE(100 - ((&APIASPAVL / +                                              14/04/03
   9200                           &APIASPTOT) * 100))                                                                   14/04/03
   9300                                                                                                                 14/04/03
   9400 /* Move *DEC to *CHAR fields  */                                                                                14/04/03
   9500              CHGVAR     VAR(&APIASPUSE) VALUE(&PERUSED)                                                         14/04/03
   9600              CHGVAR     VAR(&ASPTOT) VALUE(&APIASPTOT)                                                          14/04/03
   9700              CHGVAR     VAR(&ASPNO) VALUE(&APIASPNO)                                                            14/04/03
   9800              CHGVAR     VAR(&ASPTHLD) VALUE(&APIASPTHLD)                                                        14/04/03
   9900                                                                                                                 14/04/03
  10000              IF         COND(&TYPE *EQ '0') THEN(GOTO CMDLBL(BATCH))                                            17/04/03
  10100                                                                                                                 17/04/03
  10200              SNDBRKMSG  MSG('ASP No: ' *CAT &ASPNO *CAT '    ASP +                                              23/04/03
  10300                           %Threshold: ' *CAT &ASPTHLD *CAT '     +                                              23/04/03
  10400                           ASP %Used: ' *CAT &APIASPUSE) +                                                       23/04/03
  10500                           TOMSGQ(&TERMINAL)                                                                     23/04/03
  10600 batch:                                                                                                          17/04/03
  10700 /* Set up file ASPTHRESH2, containing ASP Threshold%   */                                                       16/04/03
  10800              CHGDTAARA  DTAARA(QGPL/ASPTHRESH) VALUE(&ASPTHLD)                                                  16/04/03
  10900                                                                                                                 16/04/03
  11000              DSPDTAARA  DTAARA(QGPL/ASPTHRESH) OUTPUT(*PRINT)                                                   16/04/03
  11100                                                                                                                 16/04/03
  11200              CPYSPLF    FILE(QPDSPDTA) TOFILE(QGPL/ASPTHRESH) +                                                 16/04/03
  11300                           SPLNBR(*LAST) MBROPT(*REPLACE)                                                        16/04/03
  11400                                                                                                                 16/04/03
  11500  RUNQRY:     RUNQRY     QRY(ASPTHRESH)                                                                          16/04/03
  11600                                                                                                                 16/04/03
  11700              ENDPGM                                                                                             01/04/03
                                  * * * *  E N D  O F  S O U R C E  * * * *
                                                   

Related Topics: iSeries skills, VIEW ALL TOPICS

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: