home *** CD-ROM | disk | FTP | other *** search
- Process Apost DateTime.
- Identification Division.
- Program-Id. ECHOCBL.
-
- Environment Division.
- Configuration Section.
- Source-Computer. IBM-AS400.
- Object-Computer. IBM-AS400.
-
- Input-Output Section.
- File-Control.
-
- Select ICF
- Assign to Workstation-ECHOICF-SI
- Organization Transaction
- Status ICF-FD-Status, ICF-Major-Minor-Code.
- I-O-Control.
-
- Data Division.
- File Section.
-
- FD ICF
- Label records are standard.
- 01 ICF-Record.
- Copy DDS-All-Formats Of ECHOICF.
-
- Working-Storage Section.
-
- * Feedback for ICFF.
- 01 ICF-FD-Status Pic X(02).
- 01 ICF-Major-Minor-Code Pic X(04).
- 01 ICF-Read-Rcd-Fmt Pic X(10) Value 'RCVRCD'.
- 01 ICF-Write-Rcd-Fmt Pic X(10) Value 'SNDRCD'.
- 01 ICF-Device Pic X(10) Value 'ECHOICF'.
-
- * Indicators.
- 01 Indics.
- 03 Ind Pic 1(1) Occurs 99 Indicator 1.
- 88 C-Indicator-On Value B'1'.
- 88 C-Indicator-OFF Value B'0'.
-
- 01 ADDLIBLE-Cmd.
- 02 Filler PIC X(9) VALUE 'ADDLIBLE '.
- 02 ADDLIBLE-Lib Pic X(10).
- 01 ADDLIBLE-Cmd-Len PIC S9(10)V9(5) COMP-3 VALUE 19.
-
-
-
- * Received record format.
- 01 ReceivedRecord.
- 02 ReceivedLen Pic 9(02) COMP-4.
- 02 ReceivedData Pic X(32758).
-
- Linkage Section.
- 01 Product-Library Pic X(10).
-
- *****************************************************************
- Procedure Division using Product-Library.
- *****************************************************************
- Sub-Main-Section Section.
-
- Sub-Main.
-
-
- *---------------------------------------------------------------*
- * Set up the library list so that run time objects can be found.*
- *---------------------------------------------------------------*
- Move Product-Library TO ADDLIBLE-Lib.
- Call 'QCMDEXC' Using ADDLIBLE-Cmd ADDLIBLE-Cmd-Len.
-
-
- *---------------------------------------------------------------*
- * Open ICF file and acquire device. *
- *---------------------------------------------------------------*
- Open I-O ICF.
- Acquire ICF-Device for ICF.
-
- *---------------------------------------------------------------*
- * Initial "priming" read. *
- *---------------------------------------------------------------*
- Read ICF
- Format is ICF-Read-Rcd-Fmt
- Indicators are Indics.
-
- *---------------------------------------------------------------*
- * Loop until the PC issues an Deallocate command which will *
- * set indicator 82 on, or until indicator 66 (receive failed) *
- * is set on. *
- *---------------------------------------------------------------*
- Perform Process-Request thru Process-Request-Exit
- until C-Indicator-On(82)
- or C-Indicator-On(66).
- *---------------------------------------------------------------*
- * Drop ICF Device. *
- *---------------------------------------------------------------*
- Drop ICF-Device from ICF.
-
- Close ICF.
-
- Exit Program.
- Stop Run.
-
-
- *****************************************************************
- Subroutine Section.
- *****************************************************************
-
- *****************************************************************
- * Subroutine - Process-Reequest. *
- *****************************************************************
- Process-Request.
-
- * Set the length of the output buffer to be the received len
- * and move the input data to the output data (echo back what
- * was received).
- Move RCVDATA of RCVRCD-I to ReceivedRecord
- Compute SNDLEN of SNDRCD-O = ReceivedLen.
- Move RCVDATA of RCVRCD-I to SNDDATA of SNDRCD-O.
-
-
- Write ICF-RECORD
- Format is ICF-Write-Rcd-Fmt.
-
- Read ICF
- Format is ICF-Read-Rcd-Fmt
- Indicators are Indics.
-
-
- Process-Request-Exit. Exit.
-