Use of data queues

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.