The Directive can be very effective when a TELNET application repeats prompts between reporting sections. This example is problematic as for each iterative reporting cycle, the transaction is essentially reset on the TELNET application to start. The TeLEnvy XML Library generally handles transaction processing in a similar manner.

The following example describes a TELNET application case of a repeating section within the application transaction:

See Also:

DataWithinRegion – Using Regular Expressions

CHARON$$$ MANMAN Execute the TELNET Application

PLANT CODE (ACMETOOLs)? * Select the "Plant Code" environment from which the data are reported

COMPUTER ASSOCIATES INTERNATIONAL, INC.
 (c) COPYRIGHT 2000

CA-MANMAN on AXP V11.3 PLANT CODE: ACMETOOLS 23-FEB-2018 22:12:55

COMMAND (ACMETOOLS, OMAR)? AP RE 630 *

MANMAN/AP,RE,630 PLANT CODE: ACMETOOLS 23-FEB-2018 22:13:00
 DESCRIPTION: Post-Payment Summary

ENTER DESIRED OUTPUT OPTION:
 -1. CREATE BATCH JOB COMMAND FILE
 0. LINE PRINTER, 132 COLUMNS
 1. TERMINAL, 132 COLUMNS
 2. OTHER QUEUE/DEVICE, 132 COLUMNS
 3. DISK FILE STORAGE
 OUTPUT OPTION (0)? 1 * Output Option - To Terminal Session

BANK CODE? 3 * Start Transaction here for the next Bank Code
 BANK CODE? * Optional - report from multiple banks during the same reporting cycle

REMIT-TO VENDOR CODE? A * Filter - include all Remite To Vendors
 DO YOU WANT TO INCLUDE VOIDED PAYMENTS (N)? * Do not include Voided Payments

DATE OPTION:
 1. DATE RANGE
 2. FISCAL PERIOD
 3. CURRENT FISCAL PERIOD
 OPTION (3/1/2)? 1* Filter the report to Payments paid in the following date range

START DATE? 0201 * All Payments from 0201 (Feb 01, current year)
 END DATE? 0223 * All Payments through 0223 (Feb 23, current year)

SORT OPTION:
 1. PAYMENT NUMBER
 2. VENDOR CODE
 3. PAYMENT DATE
 OPTION (1/2/3)?1* Sort report by Payment Number

GATHERING DATA: 23-FEB-2018 22:14 Gather Data
 SORTING DATA: 23-FEB-2018 22:14 Sort Data
 PRINTING DATA: 23-FEB-2018 22:14 Print Data - the output device is TERMINAL session.

[——————The captured Output Follows: —————]

AP,RE,630,1 ACMETOOLS PLANT PLANT CODE: ACMETOOLS REQUESTER: XYZ
 23-FEB-20XX 22:14 POST PAYMENT SUMMARY REPORT PAGE NO: 1
 ===========================
 FOR PAYMENT DATES FROM 02/01/XX TO 02/23/XX
 SORTED BY PAYMENT NUMBER

BANK CODE: 3
 BANK NAME: AN US BANK

PAYMENT PAYMENT VENDOR VENDOR NAME STAT PMT PAYMT AP ACCOUNT DISCT ACCT CASH ACCT DISCT
 NUMBER DATE CODE TYPE AMOUNT DEBITED CREDITED CREDITED LOST
 -------- -------- ---------- --------------------------- ----- ---- ------------ ------------ ---------- ------------ ----------
 12019 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12020 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12021 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12022 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12023 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12024 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12025 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12026 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12027 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12028 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12029 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
AP,RE,630,1 ACMETOOLS PLANT PLANT CODE: ACMETOOLS REQUESTER: XYZ
 23-FEB-20XX 22:14 POST PAYMENT SUMMARY REPORT PAGE NO: 2
 ===========================
 FOR PAYMENT DATES FROM 02/01/XX TO 02/23/XX
 SORTED BY PAYMENT NUMBER

BANK CODE: 3
 BANK NAME: AN US BANK

PAYMENT PAYMENT VENDOR VENDOR NAME STAT PMT PAYMT AP ACCOUNT DISCT ACCT CASH ACCT DISCT
 NUMBER DATE CODE TYPE AMOUNT DEBITED CREDITED CREDITED LOST
 -------- -------- ---------- --------------------------- ----- ---- ------------ ------------ ---------- ------------ ----------
 12041 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12042 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12043 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12044 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12045 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12046 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12047 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12048 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12049 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12050 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12051 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00

AP,RE,630,1 ACMETOOLS PLANT PLANT CODE: ACMETOOLS REQUESTER: XYZ
 23-FEB-20XX 22:14 POST PAYMENT SUMMARY REPORT PAGE NO: 3
 ===========================
 FOR PAYMENT DATES FROM 02/01/XX TO 02/23/XX
 SORTED BY PAYMENT NUMBER

BANK CODE: 3
 BANK NAME: AN US BANK

PAYMENT PAYMENT VENDOR VENDOR NAME STAT PMT PAYMT AP ACCOUNT DISCT ACCT CASH ACCT DISCT
 NUMBER DATE CODE TYPE AMOUNT DEBITED CREDITED CREDITED LOST
 -------- -------- ---------- --------------------------- ----- ---- ------------ ------------ ---------- ------------ ----------
 12052 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12053 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12054 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12055 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00
 12056 02/22/XX XX11 XX11 OPEN AUTO 100.62 317.62 1.00 7.62 0.00

------------ ---------- ------------ ----------
 BANK 3 TOTAL: 43340.25 0.00 43340.25 0.00

------------ ---------- ------------ ----------
 REPORT TOTALS: 8575.74 0.00 205.74 0.00

BANK CODE? E * Start Transaction here for the next Bank Code. All prompts are repeated as listed above. This transaction terminates when send the "E[nd]" response.

**3 PAGES (NN LINES) WRITTEN TO REPORT**
 END OF REPORT; PRESS RETURN TO CONTINUE: E*

COMMAND (ACMETOOLS, AP)? E * Exit the TELNET Application
EXITING MANMAN

TeLEnvy XML:

An Example (APR630) XML Script that generates the above report, and returns it to the application.

<?xml version="1.0" encoding="utf-8" ?>
<Session>
 <!-- OpenVMS MANMAN - APR630 - Accounts Payable - Post Payment Summary Report -->
 <!-- Each transaction is executed within the context of a TELNET session. Setup the session info default. -->

<SessSeq ServerName="10.1.4.40" ServerTimeout="5000" DebugEnabled="true" LoggingEnabled="true" RecordingEnabled="true">
 <Expect>([Uu]sername)|([Ll]ogin): ?</Expect> <!-- Expect Credentials Prompt Username -->
 <SendEnter>PEER</SendEnter> <!-- Send the Credentials Username -->
 <Expect>[Pp]assword: ?</Expect> <!-- Expect Credentials Prompt Password -->
 <SendEnter>xxxxxxxx</SendEnter> <!-- Send the Credentials Password -->
 <Expect>((\r)|(\n)).?CHARON[$][$][$] </Expect> <!-- Expect the TELNET OpenVMS DCL Prompt -->
 <SendEnter>SET TERMINAL/NOBROADCAST</SendEnter> <!-- Send OpenVMS commands disable broadcast messaging to terminal. -->
 <SendEnter>SET TERMINAL/width=132</SendEnter> <!-- Set the terminal screen's page width to 132 columns - Zero Referenced -->
 <SendEnter>SET TERMINAL/PAGE=24</SendEnter> <!-- Set the terminal screen's page length to 24 rows - Zero Referenced -->
 <SendEnter>MANMAN</SendEnter><!-- --> <!-- Send the command to start the OpenVMS application -->
 <Expect>PLANT CODE.*\*</Expect> <!-- Expect the next data received to the API is this application prompt -->
 <SendEnter>ACMETOOLS</SendEnter> <!-- Send to the transaction the data which responds to the application prompt -->
 <WaitForData>COMMAND.*\*</WaitForData> <!-- Wait for the application command line -->
 <SendEnter>AP RE, 630</SendEnter> <!-- Application Transaction --> 
 <SendEnter>1</SendEnter> <!-- 1. TERMINAL --> 
 <SendEnter>3</SendEnter> <!-- BANKCODE -->
 <SendEnter></SendEnter> <!-- BANK CODE CONTINUE -->
 <SendEnter>ALL</SendEnter> <!-- REMIT TO VENDOR CODE -->
 <SendEnter>N</SendEnter> <!-- VOIDED PAYMENTS -->
 <SendEnter>1</SendEnter> <!-- DATE OPTION 1/2/3 -->
 <SendEnter>0201</SendEnter> <!-- START DATE -->
 <SendEnter>0223</SendEnter> <!-- END DATE -->
 <SendEnter>1</SendEnter> <!-- SORT OPTION 1/2/3 -->
 <!-- Line-application multipage output - the application starts the reporting cycle given the responded prompts above. -->
 <!-- We need to use a regular expression to check the returned data for a string literal. -->
 <!-- This is an unusual case as the string "Pattern" the session is looking is (in part) included as a string in the data. -->
 <!-- To ensure the pattern matches in the data's transaction location, use a regular expression. -->
 <Expect Name="BANKCODE" Grab="True">([B][A][N][K].[C][O][D][E][?])</Expect> <!--Receive and grab data until Continue? or next prompt is received-->
 <!-- Begin the While directive. The condition element is loaded from an array for the condition and all prompts are repeated. -->
 <While>

<!-- The <IfCondition> responds to a repeating section in the response profile for a transaction. Note, that we will look for the prompt [B][A][N][K].[C][O][D][E][?] using the regular expression
 as the command permits reporting from multiple banks before displaying the END OF REPORT message. So, we will iterate through the "BANK CODE?" prompts. 
 For this case - we will just %lt;SendEnter&gt; to send a CR - to move past the prompt.
 The "Desired Report Option" is prompted by the application in the "repeating" section. Send a response to the "Report option" and move past the prompt.
 Again Grab any data until we encounter (BANK CODE?) or (END OF REPORT;) - again - the pattern used is a Regular Expression

Type="DataWithinRegion" informs the TelEnvy processor data that should be tested is expected at the page coordinates from Row, Column, Width and Height.

Row - the starting ordinal row of the Virtual Terminal
 Column - the starting ordinal column in the Virtual Terminal
 Width - The number of columns on the Row that should be tested for this condition.
 Height - the number of rows which precede the value from Row to be tested for this condition.

Grab="True" sends data from the Virtual Terminal where it is captured via the TeLXMLLib.GrabChanged event. The "Name" of the object containing the data is set from the Name="BANKCODE" attribute.
 -->

<IfCondition Type="DataWithinRegion" Row="23" Column="0" Width="80" Height="1" Pattern="([B][A][N][K].[C][O][D][E][?])"> <!--If when testing for this string (BANK CODE?) is found we have another repeat the prompts below-->
 <SendEnter></SendEnter> <!--Send CR-ENTER to continue-->
 <SendEnter>2</SendEnter> <!--DESIRED REPORT OPTION -->
 <Expect Name="BANKCODE" Grab="True">([B][A][N][K].[C][O][D][E][?])|([E][N][D][ ][O][F][ ][R][E][P][O][R][T][;])</Expect> <!--There is either a repeating section (BANK CODE?) or (END OF REPORT;)-->
 </IfCondition>
 
 </While> <!--Repeat-->
 <SendEnter>E</SendEnter> <!-- REMIT TO VENDOR CODE -->
 <SendEnter></SendEnter> <!-- PRESS RETURN TO CONTINUE -->
 <Expect>COMMAND.*\*</Expect>
 <SendEnter>E</SendEnter> <!-- Exit MANMAN -->
 <Expect>((\r)|(\n)).?CHARON[$][$][$]</Expect>
 <SendEnter>LO</SendEnter> <!-- Log Out -->
 </SessSeq>
</Session>