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

  • 相关阅读:
    学习笔记(二)Eclipse设置 Servlet配置及初始化参数读取 及Servlet应用
    html实例
    如何使用JDBC调用存储在数据库中的函数或存储过程 */
    如何使用 JDBC 调用存储在数据库中的函数或存储过程
    c3p0数据库连接池使用--创建JDBCTools 公共类
    创建DBCP数据源
    使用Batch批量添加数据
    sqlserver事务隔离级别
    事务处理
    得到数据库自动生成的主键值
  • 原文地址:https://www.cnblogs.com/wildfish/p/1031891.html
Copyright © 2011-2022 走看看