6888281 Tsqs and Ceci

download 6888281 Tsqs and Ceci

of 3

Transcript of 6888281 Tsqs and Ceci

  • 7/28/2019 6888281 Tsqs and Ceci

    1/3

    Normally, temporary storage control maintains TSQs in single VSAM ESDS called temporary storagefile or DFHTEMP. For pseudo conversational programs, thats an efficient way to store data betweenprogram executions. The one big advantage the TSQs have over communication area is that it makesbetter use of the systems resources by not tying up the main memory for long periods of time.

    One can also store the TSQs on disks as Temporary Storage Control allows that but thatmeans overheads in storing and retrieving the data in a single task execution. But if we specify mainstorage over disk, the processing is faster at the cost of critical main memory in the CICS system.

    1. Write to a TSQ (creates the Q if not present already)

    EXEC CICSWRITEQ TS QUEUE(TS-QUEUE-NAME)

    FROM(TS-QUEUE-RECORD)LENGTH(TS-QUEUE-LENGTH)[ MAIN ][ AUXIALLIARY ]

    END-EXEC.

    TS-QUEUE-LENGTH : PIC S9(4) COMP FIELD (Half-Word binary).TS-QUEUE-NAME : 1 TO 8 CHARACTER name that should be unique to avoid using other TSQs.

    MAIN/AUXIALLIARY : Specifies that TSQ shall reside on main/disk storage. OPTIONAL FIELDS.

    2. Update an existing record.

    EXEC CICSWRITEQ TS QUEUE(TS-QUEUE-NAME)

    FROM(TS-QUEUE-RECORD)LENGTH(TS-QUEUE-LENGTH)ITEM(TS-ITEM-NUMBER)REWRITERESP(RESPONSE-CODE)

    END-EXEC.

    Within a TSQ, each record is assigned an ITEM-NUMBER just like an array-index. The item #s start from1,2,..To rewrite a record in the TSQ you need to specify the item number of the record to be updated.Since most TSQs have one record only that is updated, its never a problem. In case a TSQ name is notfound it raises a QIDERR. In case it doesnt find the item-number, then an ITEMERR is raised.

    3. To read from a TSQ :

    EXEC CICSREADQ TS QUEUE(TS-QUEUE-NAME)

    INTO(TS-QUEUE-RECORD)LENGTH(TS-QUEUE-LENGTH)ITEM(TS-ITEM-NUMBER)RESP(RESPONSE-CODE)

    [ NEXT ]END-EXEC.

    NEXT : Specifies that the next record in the sequence following the most recently read record should beread. OPTIONAL

    parameter. Its always a good practice to use the item #.

    In case of a readq also, the possible exceptions are QIDERR and ITEMERR. The response codecan be used to handle an abnormal termination as in any CICS program.

  • 7/28/2019 6888281 Tsqs and Ceci

    2/3

    4. Deleting a TSQ :

    EXEC CICSDELETEQ TS QUEUE(TS-QUEUE-NAME)

    END-EXEC.

    this command needs to be issued explicitly after the completion of processing to delete the TSQ.If we do not, then the TSQ remains indefinitely wasting storage space. The command deletes the entireTSQ and not just the record. That shouldnt be problem either coz most of the times the TSQ is going tohave a single entry.

    All the variables used will be defined in the working storage before you can use these lines of code inyour program. Something like

    WORKING-STORAGE DIVISION.

    01 TSQ-AREA.

    05 TS-QUEUE-RECORD PIC X(100).05 TS-QUEUE-NAME PIC X(8).

    05 TS-QUEUE-LENGTH PIC S9(4) COMP.05 TS-ITEM-NUMBER PIC 9(02).

    .PROCEDURE DIVISION.

    2000-PROCESS SECTION...MOVE NIL001 TO TS-QUEUE-NAME.MOVE WS-Q-RECORD TO TS-QUEUE-RECORD.MOVE 100 TO TS-QUEUE-LENGTH...EXEC CICS WRITEQ TS QUEUE(TS-QUEUE-NAME

    FROM(TS-QUEUE-RECORD)LENGTH(TS-QUEUE-LENGTH)

    END-EXEC.

    CECI

    Description: CECI = Command-Level Interpreter

    Enables CICS commands to be entered, syntax-checked, andexecuted interactively at a 3270 screen. The interpreterperforms a dual role in the operation of a CICS system.

    For the application programmer, it provides a reference tothe syntax of the complete CICS command-level applicationprogramming interface. Most of the commands can be carriedthrough to execution, and the results of execution can bedisplayed. For the system administrator, it provides ameans of interaction with the system. The command-levelinterpreter can be invoked by two CICS-suppliedtransactions, CECI and CECS. CECI invokes the commandlevel interpreter to enter an EXEC CICS command, checks itssyntax, and you modify it as necessary. In most cases, you

  • 7/28/2019 6888281 Tsqs and Ceci

    3/3

    can also process the command. CECS invokes thesyntax, and you modify it as necessary. In most cases, youcan also process the command. CECS invokes thecommand-level interpreter to check the syntax of an EXECCICS command but not to process it.