zoukankan      html  css  js  c++  java
  • 数据队列的用处

    One example: PRINTING A SPOOL ON BOTH SIDES OF THE PAPER


    Follow the Steps:

    1. Create a new DTAQ by the following command:
    CRTDTAQ DTAQ(QGPL/ZDTAQ1) MAXLEN(64512)

    2. Create a OUTQ with the following command:
    CRTOUTQ OUTQ(QGPL/DUPLEX) DTAQ(QGPL/ZDTAQ1)

    3. Compile the following CL program after making necessary modifications to it. (You probably need to change the out queue name in the last CL command CHGPLFA)

    Note 1:
    The program needs to be running all the time in the system. The program doesn't take any CPU resource as it waits in DEQW status until a spool file comes in the OUTQ.

    Note 2:
    You may want to add the CALL to this program in the system startup program, so that it gets executed automatically, after every IPL.

    So, from now on, whenever you need to print the spool file on the both sides of a paper, just send the spool file to the OUTQ DUPLEX instead of the regular OUTQ (PRINT01 in this case). The output will appear on PRINT01 (your actual existing OUTQ) only.

    To print regular one-sided spool files simply send the spool files to PRINT01 (your actual existing OUTQ).

    Code


    CL Program:
    /**********************************************************************/
    /* Author : Ravinder K. Pal
    */
    /* Description : Print both sides of the paper (driver)
    */
    /**********************************************************************/
    PGM
    DCL VAR(&FLDLEN) TYPE(*DEC) LEN(5 0) VALUE(128)
    DCL VAR(&FIELD) TYPE(*CHAR) LEN(128)
    DCL VAR(&ERR) TYPE(*CHAR) LEN(50)
    DCL VAR(&SPLNBR) TYPE(*DEC) LEN(9 0)
    DCL VAR(&USER) TYPE(*CHAR) LEN(10)
    DCL VAR(&SPLNM) TYPE(*CHAR) LEN(10)
    DCL VAR(&JOBNM) TYPE(*CHAR) LEN(10)
    DCL VAR(&JOBNBR) TYPE(*CHAR) LEN(6)
    DCL VAR(&ERR) TYPE(*CHAR) LEN(50)
    DCL VAR(&TNAME) TYPE(*CHAR) LEN(50)
    DCL VAR(&FM) TYPE(*CHAR) LEN(32)
    DCL VAR(&SNAME) TYPE(*CHAR) LEN(
    DCL VAR(&WAIT) TYPE(*DEC) LEN(5 0)
    LOOP: CHGVAR VAR(&WAIT) VALUE(-1) /* wait for new entry +
    on the data queue */
    CHGVAR VAR(&FIELD) VALUE(' ')
    CALL PGM(QRCVDTAQ) PARM(ZDTAQ1 QGPL &FLDLEN &FIELD +
    &WAIT)
    /* Get the Spool file number for the spool file */
    CHGVAR VAR(&SPLNBR) VALUE(%BIN(&FIELD 49 4))
    /* Get the Job name for the spool file */
    CHGVAR VAR(&JOBNM) VALUE(%SST(&FIELD 13 10))
    /* Get the user ID for the spool file */
    CHGVAR VAR(&USER) VALUE(%SST(&FIELD 23 10))
    /* Get the Job Number for the spool file */
    CHGVAR VAR(&JOBNBR) VALUE(%SST(&FIELD 33 6))
    /* Get the spool file name */
    CHGVAR VAR(&SPLNM) VALUE(%SST(&FIELD 39 10))

    CHGSPLFA FILE(&SPLNM) JOB(&JOBNBR/&USER/&JOBNM) +
    SPLNBR(&SPLNBR) DUPLEX(*YES)
    MONMSG CPF0000
    CHGSPLFA FILE(&SPLNM) JOB(&JOBNBR/&USER/&JOBNM) +
    SPLNBR(&SPLNBR) OUTQ(PRINT01)
    /* PRINT01 is used as an example. Instead of PRINT01, you will use the name
    of an existing OUTQ */

    GOTO CMDLBL(LOOP)
    ENDPGM

  • 相关阅读:
    电感(29)之铁氧体磁珠工作原理透彻详解
    电阻(7)之零欧姆电阻
    高速数字逻辑电平(8)之LVDS差分信号深度详解
    每天进步一点点------Error: Can't place pins assigned to pin location Pin_K22 (IOPAD_X41_Y19_N14)
    每天进步一点点------入门视频采集与处理(视频分辨率介绍)
    每天进步一点点------入门视频采集与处理(显示YUV数据)
    每天进步一点点------YUV格式详细解释
    每天进步一点点------入门视频采集与处理(BT656简介)
    每天进步一点点------FPGA 静态时序分析模型——reg2reg
    每天进步一点点------SysTimer
  • 原文地址:https://www.cnblogs.com/wildfish/p/1031891.html
Copyright © 2011-2022 走看看