Customizing Scripts with the REXX Script Processor (VTAM)
The REXX script processor automates writing REXX routines in Performance Test scripts and helps you create “smart” scripts. The REXX script processor modifies previously recorded scripts and inserts REXX instructions and routines into them. REXX provides logic in the scripts to enhance playback. The logic in these processed scripts automatically handles common obstacles that occur when testing applications such as SAP.
This section describes the REXX script processor functions, how to run the processor, the structure of processed scripts, and tips for troubleshooting problems that may occur.
REXX Script Processor features
The REXX script processor can perform:
- Data Replacement — When a recorded Performance Test script contains an application-generated output field on a screen (document number, invoice number, etc.) that is later typed as input, the data replacement function replaces the user-typed field with the new field value that is generated by the application when the script is played back. For more information see Data Replacement.
- Date Recalculation — When a recorded Performance Test script contains user-typed date input fields (such as a due date or delivery date), the date recalculation function replaces the date input fields with a new date when the script is played back. The new date is the original input date recalculated relative to the date when you run playback. The date recalculation function can also recalculate dates that appear on recorded script output screens. For more information see Date Recalculation.
- Multi-Field Date Recalculation — The multi-field date recalculation function allows you to recalculate input and output dates that span fields, such as when the month, day, and year are contained in different fields. For more information see Multi-Field Date Recalculation.
- List Processing — When a recorded Performance Test script contains a screen that provides rows that can be selected (such as a directory), the list processing function causes playback to select the same row that was selected when the script was recorded. The list processing function selects the same row even if the row has changed its location in the list. The row can even be on a different list page. For more information see List Processing.
- Synchronization — When unexpected application messages appear randomly during the recording or playback of a Performance Test script, playback may get out of sync with the application being tested. The synchronization function detects messages (such as ‘...Processing’) in the recorded script and when they appear during playback. It takes the appropriate action to handle the message and to keep the playback synchronized with the application. For more information see Synchronization.
Using the REXX Script Processor
Select option 1 REXX Processor on the Script Processors screen and press Enter. The REXX Script Processor * Primary Options screen appears.
REXX Script Processor Primary Options screen
Option ===>
1 Data Replacement 3 List Processing
2 Date Recalculation 4 Synchronization
Go Begin Execution 5 Multi-Field Date Recalculation
C Convert Control File
Specify the name of the control file below, then press Enter key
Project . . .
Group . . . .
Type . . . .
Member. . . .
Other Data Set Name:
Data Set Name . . .
REXX Script Processor control file
The REXX script processor stores user-entered information in a control file. When you run the REXX script processor, it reads each input script and creates a new script containing the REXX logic. The control file is also read in by the script processor. The information in the control file tells the script processor how to write the REXX logic.
For example, for the REXX script processor to write a date recalculation routine into a script, you must first create a date recalculation entry. This entry is stored in the control file. The date recalculation entry contains information such as the format of the dates to be recalculated and where the date fields are located. The script processor reads in that information and matches it against the input script. Then it creates a new script containing the REXX routines necessary to recalculate the selected dates. These REXX routines execute when the script is played.
Each Performance Test site can share a single control file or many control files. The control file entered on the REXX Script Processor * Primary Options screen is the one used by the script processor. Each entry in the control file creates more work for the script processor to perform. Therefore, the script processor takes longer to run if the control file contains many entries.
The control file can be a sequential file or a member of a partitioned data set (PDS). There are no specific requirements for the record length, record format, or block size of the control file. However, fixed block record format with an 80-byte record length is recommended.
If the chosen control file does not exist when you start the REXX script processor, the Allocate Control File pop-up window appears to prompt you to allocate a new control file.
Allocate Control File Pop-up Window
Option ===> 1
.------------------------ ALLOCATE CONTROL FILE -------------------------.
| |
G | Command ===> |
| |
| Press Enter to allocate the dataset, END to exit |
Spe | |
| Data Set Name . . . : 'PMIJSS0.JMS.CONTROL.FILE(FILE1)' |
P | |
G | Volume Serial . . . . |
T | Space Units . . . . . TRKS (TRKS or CYLS) |
M | Primary Quantity. . . 3 (In above units) |
| Secondary Quantity. . 1 (In above units) |
Oth | Directory Blocks. . . 5 (Zero for sequential data set) |
D | Record Format . . . . FB |
| Record Length . . . . 80 |
| Block Size. . . . . . 800 |
| |
| |
'------------------------------------------------------------------------'
Control File Conversion Utility
Both single field date recalculation and multi-field date recalculation control file entries used by releases of Performance Test prior to 6.1.0 need to be converted before they can be used with Performance Test release 6.1.0 or more current.
The Control File Conversion utility converts control files used by prior releases of Performance Test’s REXX script processor to the format required by Performance Test release 6.1.0 or more current.
If the control file is a data set, you can convert all members inside the data set at the same time or perform a selective conversion. Also, Performance Test can process either in the foreground or background (batch).
The Control File Conversion utility does not validate control file entries. Any unknown keywords found in the control file are written as they are to the output file.
Starting the Control File Conversion Utility
Type C Convert Control File on the REXX Script Processor * Primary Options screen command line and press Enter to display the Control File Conversion Utility screen.
Control File Conversion Utility screen----------------------- Control File Conversion Utility -----------------------
OPTION ===>
F Initiate Processing In Foreground.
B Initiate Processing In Background.
Specify Input Control File Name:
Dataset name ===> 'PMIJSS0.JMS.CONTROL.FILE'
Member name/pattern ===> (For PDS only)
Display Member List ===> (For PDS only) Y Yes, N No
Specify Output Control File Name:
Dataset name ===> 'PMIJSS0.SMOKE.SCRIPTS.CONTROL'- Enter the Input Control File Name:
- Dataset Name is the data set containing the control file entries to be converted. It can be either a PDS or sequential data set. Do not enter a member name.
- Member Name/Pattern: If the input control file is a PDS, you can enter a valid member name pattern to limit member selection.
- Display Member List: Y displays the member selection list so you can choose members for conversion. N indicates that the member selection list is not required. In this case, Performance Test processes all members matching the pattern.
- Enter the Output Control File Name:
- Dataset Name is the data set where you want to save the converted entries. If this data set does not already exist, Performance Test creates it using the attributes of the input control file. If this data set already exists, it must have the same DSORG as the input control file. You cannot change the member name for the output control file (the same member names from the input control file are always used).
- Enter the F primary command to convert the control file in TSO foreground or the B primary command to convert the control file in TSO background (batch) mode.
After filling in the required information, press ENTER. If you requested a member selection list, a screen appears from which you can choose members for conversion (see the Control File Conversion Utility, Member Selection List).
Control File Conversion Utility, Member Selection ListMEMBER LIST -- USER25.CNTL.FILE -------------------------ROW 00001 OF 00011
COMMAND ===> SCROLL ===>PAGE
END End and process selection
CANcel End without processing
Line Cmds: S Select member B Browse member
Name VV MM Created Changed Size Init Mod
ALL
ALLB 01.00 07/05/15 07/05/15 15:06 182 182 0 PF
DOC
DOCMF
INP
MC
NOSEP
OPTN2
R600
SET 01.00 07/05/15 07/05/15 15:06 182 182 0 PF
T1
**End**- Press END to process your selection or CANCEL to exit without processing your selection. Valid line commands include S(earch) and B(rowse). See the online help for a description of these commands.
Data replacement
Use the data replacement script processor when the recorded script performs an action that causes an application to show a unique output field on a screen that is later typed in as input to that application. The selected value from the output field is then used to replace matching input fields further along in the script.
Data replacement can be demonstrated with the following scenario. A user records a script of the activities required to create a document number, and later inquires on that document number. When the document is created, the application shows the new document number in an output field on line 24 (see the Create the Document Number during the Recording figure).
Create the document number during the recording
-------------------------------------------------------------------------------
Shipment Schedule ------ Consignee ------ Carr T
Number Ship Dte Name Reference SCAC M Material Name Vehicle Id
-------------------------------------------------------------------------------
00407654 05/17/07 COMPUWARE 9999 XXXX T YYYYYYYYYYYYY ZZZZZZZZZZ
.
.
.
OK _ I012 Document created under number 49012345 01/01
A few screens later, the application prompts for the document number (see the Application’s Display Document screen).
Application’s Display Document screen
------------------------------------------------------------------------------- Doc.No....... ?
Company Code. ?
.
.
.
OK _ 1 -42170
Type the document number as input on the Display Document screen (see the Document Number Entered as Input During Recording screen).
Document number entered as input during recording
-------------------------------------------------------------------------------
Doc.No....... 49012345
Company Code. 6
.
.
.
OK _ 1 -42170
When this recorded script is played back, the application creates a new unique document number. But when the document number is entered as input on the Display Document screen, the original document number (49012345) is used.
The data replacement function solves this problem by replacing the input document number in the output field on the Display Document screen with a REXX variable. The value of this REXX variable is the document number that the application generates during playback.
The following figures show the data replacement logic taking effect. During playback, a new document number is created (49055512). This new number replaces 49012345 on the Display Document screen. The data replacement logic handles situations where the application-generated field is typed into only one input field or into many fields throughout the script.
New document number created during playback
-------------------------------------------------------------------------------
Shipment Schedule ------ Consignee ------ Carr T
Number Ship Dte Name Reference SCAC M Material Name Vehicle Id
-------------------------------------------------------------------------------
00407654 05/16/07 COMPUWARE 9999 XXXX T YYYYYYYYYYYYY ZZZZZZZZZZ
.
.
.
OK _ I012 Document created under number 49055512 01/01
Application’s Display Document screen
-------------------------------------------------------------------------------
Doc.No....... ?
Company Code. ?
.
.
.
OK _ 1 -42170
Original document number being replaced during playback
-------------------------------------------------------------------------------
Doc.No....... 49055512
Company Code. 6
.
.
.
OK _ 1 -42170
Starting data replacement
Select option 1 Data Replacement from the REXX Script Processor * Primary Options screen to display the REXX Script Processor * Data Replacement screen.
Use this screen to prepare the script processor to write data replacement REXX logic into your scripts.
REXX Script Processor Data Replacement screen
Option ===> Scroll ===>
Add Create New Data Replacement Entries
Line Cmds: U Update D Delete B Browse
Field Field
Screen ID Location Length Description
-------------------------------------------------------------------------------
** NONE **
******************************* BOTTOM OF DATA ********************************
If the control file already contains data replacement entries, they are listed on the REXX Script Processor * Data Replacement screen. Otherwise, ** NONE ** appears under Screen ID.
The Add primary command displays the Performance TestREXX Script Processor * Data Replacement ADD screen where you can create new data replacement entries.
You can also update, delete, and browse data replacement entries on this screen.
The Screen ID lists the application screen where an application-generated field appears. Field Location indicates the Row and column location where the application-generated field appears on the screen. Field Length specifies the number of characters that make up the length of the application-generated field.
Adding a Data Replacement entry
Type A (Add) on the REXX Script Processor * Data Replacement screen and press Enter to display the REXX Script Processor * Data Replacement ADD screen. For the REXX script processor to handle our document number scenario, a data replacement entry (such as that shown in Data Replacement: ADD) must be added to the control file.
Data Replacement: ADD screen---------------------------- Data Replacement: ADD ----------------------------
Command ===>
ENTER Add item
END End with save of added items
CANcel End without save of added items
Enter optional data replacement entry description:
Description . . .
Describe where the system generated field is displayed:
Screen ID . . . .
ID Location . . . ** , ** (Row,Col)
Field Location. . 01 , 01 (Row,Col)
Field Length. . . 10
Enter exact match only option:
Replace Exact Matches Only . . . N (Y/N)- Enter an optional data replacement entry description to describe the data replacement entry.
- Describe where the system-generated field is displayed:
- Screen ID is the screen where an application-generated field appears. This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
- ID Location specifies the screen row and column location of the Screen ID text. Enter ** (asterisks) as wildcards in the row field and *** in the column field to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts, not the position in front of the text. Do not make any adjustments to account for attribute bytes. For example, if the screen ID text is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). The column position must be the screen column where the first character of the screen ID text is located.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens that must be processed, and no script processing will occur for this entry. - Field Location is the location of the data to be replaced. It is the screen row and column location of the application-generated field when it appears on the screen set on the screen ID field. You cannot use asterisks (**) as wildcards. The column of the field location must be the screen column position where the field text starts, not the position in front of the text. Use care when typing these values. If the field location is incorrect, no script processing occurs for this entry.
- Field Length is the number of characters that make up the application-generated field.
- Enter Y or N to specify whether to Replace Exact Matches Only. The REXX script processor replaces input fields in the script that have text that match an application-generated field. Sometimes the text does not match exactly when comparing the application-generated field with the input field.
Characters in the fields may vary between uppercase and lowercase. For example, the application generated an order number of T1034. But when the user typed it, the order number was recorded as t1034.
Leading zeros may not match. For example, the application-generated document number 0000123T8. But when the user typed it later, it was recorded as 123T8.
Input field filler characters may have been recorded. For example, the application-generated document number is 0000123T8. But when the user typed it later, the input field was prefilled with dashes (----------). Thus, the input field recorded in the script appears as <I01>123T8-----. Note that only special characters (such as: - % . #) are considered to be field filler characters.
Valid values in this field include:- N — (No) The script processor uses the length from the control file as the length for the comparison between the recorded data and the generated data. This handles situations with leading zeros and similar conditions as described in the example above.
- Y — (Yes) The script processor uses the length of the recorded data input field for the comparison. In this case, the data replacement REXX is written only in places where the input field exactly matches the corresponding application-generated field, in both value and length.
The data replacement function replaces all input fields in the script that match the system-generated or application-generated field.
- Press Enter to add the data replacement entry and remain on the current screen to add more entries. Enter END to return to the REXX Script Processor * Data Replacement screen and save all added entries in the control file. Enter CANcel to return to the REXX Script Processor * Data Replacement screen without saving added entries.
Updating a Data Replacement entry
Type U next to the desired item on the REXX Script Processor Data Replacement screen and press Enter to display the REXX Script Processor * Data Replacement UPDATE screen.
REXX Script Processor Data Replacement UPDATE screen--------------- REXX Script Processor * Data Replacement UPDATE ---------------
Command ===>
Cancel End Update Without Save
END Update Entry
Update optional data replacement entry description:
Description . . . sample add
Update where the system generated field is displayed:
Screen ID . . . . jake
ID Location . . . ** , ** (Row,Col)
Field Location. . 01 , 01 (Row,Col)
Field Length. . . 10
Update exact match only option:
Replace Exact Matches Only . . . N (Y/N)- Enter END to update the information in the control file for the selected data replacement entry and return to the REXX Script Processor * Data Replacement screen. Enter CANcel to return to the REXX Script Processor * Data Replacement screen without updating the entry.
Deleting a Data Replacement entry
- Type D next to the desired item on the REXX Script Processor Data Replacement screen and press Enter to display the Confirm Delete pop-up window.
- Press Enter to delete the information from the control file for the selected data replacement entry and return to the REXX Script Processor * Data Replacement screen or END to return to the REXX Script Processor * Data Replacement screen without deleting the entry.
Browsing Data Replacement entries
Type B next to the desired item REXX Script Processor Data Replacement screen and press Enter to display the REXX Script Processor * Data Replacement BROWSE screen.
REXX Script Processor * Data Replacement BROWSE screen--------------- REXX Script Processor * Data Replacement BROWSE ---------------
Command ===>
END End Browse
Next Browse Next Entry
Prev Browse Previous Entry
The information in the data replacement entry is shown below:
Description . . . sample add
Screen ID . . . . jake
ID Location . . . ** , ** (Row,Col)
Field Location. . 01 , 01 (Row,Col)
Field Length. . . 10
Replace exact matches only . . . N (Y/N)The Next and Prev primary commands show the next and previous data replacement entries in the control file.
After you have finished reviewing the replacement entries, press END to return to the REXX Script Processor Data Replacement screen.
Date recalculation
The REXX script processor date recalculation function handles situations where a script has dates that vary based on the date of the script playback. When this happens, the recorded date may not be valid when the script is played back, so the date recalculation function will replace the specified dates with new dates.
The following figures demonstrate a date recalculation scenario for an order entry application. On May 1, 2007, a user records the entry of a new order (see the Application’s Order Entry Screen — Delivery Date Input Field figure). During order entry, the user types 051207 in the Requested Delivery Date field.
Application’s Order Entry screen — Delivery Date Input Field
-------------------------------
Order Type........... TN
Company Code......... 06
Business Area........ 00
Unloading Pt _
Requested Deliv. Date 051207 Delivering Company... 06
Plant in Chg. xx Deliv. Plant 01
Consignee............ 2992 Ind. Manual Cons.Addr _
Carrier.............. _ Ind.Man Carrier Addr. _
Cust. non-pref. carr. _ Ind. Cust. pick-up... _
External Document No. _
OK _ PF: 12=Fast input 1 -12102
Two weeks later, the user plays back that script. The current date is May 15, 2007, but the requested delivery date is still entered as 051207, just as it was recorded. This date is in the past, and the application rejects it causing playback to fail.
The date recalculation function solves this problem by replacing the recorded date with a REXX variable that is recalculated when the script is played back. The new date is recalculated relative to the playback date. Thus, when this script is played back on 5/15/07, the delivery date field is entered as 052607 (see the Application’s Order Entry Screen — Playback Input screen).
Application’s Order Entry screen — Playback Input screen
-------------------------------
Order Type........... TN
Company Code......... 06
Business Area........ 00
Unloading Pt _
Requested Deliv. Date 052607 Delivering Company... 06
Plant in Chg. xx Deliv. Plant 01
Setting a user-defined current date
The date recalculation function can also set a user-defined “current date.” The date recalculation function determines the difference between the date on which the script was created and the input date field in the recorded script. It then adds this difference to the current date in calculating the new input date. See User-Defined Current Date Recalculation REXX for an example REXX routine.
You can also use the date recalculation function to recalculate dates that appear on recorded script output screens.
Starting date recalculation
Type 2 Date Recalculation on the REXX Script Processor * Primary Option screen and press Enter to display the Date Recalculation Item List screen. This screen lets you prepare the script processor to write date recalculation REXX logic into your scripts.
Date Recalculation Item List screen------------------------- Date Recalculation Item List ------------------------
Option ===> Scroll ===> PAGE
Add Create New Date Recalculation Items
Line Cmds: U Update D Delete B Browse
Inp fld Inp Dt Date Out Dt Wkday
Screen ID no/locn format sep locn Only Description
-------------------------------------------------------------------------------
** NONE **
******************************* BOTTOM OF DATA ********************************If the control file already contains date recalculation entries, they are listed on this screen.
- Issue the Add primary command or one of the line commands (U)pdate, (D)elete, or (B)rowse.
- The Add primary command displays the Date Recalculation: ADD screen where you can create new date recalculation entries. See Adding a Date Recalculation Entry for details.
- The (U)pdate line command displays the Date Recalculation: UPDATE screen. See Updating a Date Recalculation Entry for details.
- The (D)elete line command displays the Confirm Delete screen. See Deleting a Date Recalculation Entry for details.
- The (B)rowse line command displays the Date Recalculation: BROWSE screen. See Browsing a Date Recalculation Entry for details.
Adding a Date Recalculation entry
Type ADD on the Date Recalculation Item List screen and press Enter to display the Date Recalculation: ADD screen.
For the REXX script processor to handle the delivery date scenario, a date recalculation entry (such as that shown in the following figure) must be added to the control file.
Example Date Recalculation entry to handle delivery date--------------------------- Date Recalculation: ADD ---------------------------
Command ===>
ENTER Add item
END End with save of added items
CANcel End without save of added items
Enter optional description . . . .
Describe the location of the date field:
Screen ID. . . . . . . . . . . .
ID Location. . . . . . . . . . . ** , *** (Row,Col)
Input field number/locn of date. *** (For input dates only)
Output location of date. . . . . , (Row,Col). For output dates only.
Overlay output area. . . . . . . (Y/N). For output dates only.
Enter other date recalculation options:
Date Separator Character . . . . (Enter N for no date separator)
Weekdays Only. . . . . . . . . . S (Y/S/N)
Input Script Date Format . 1 (1-15) Output Script Date Format . 1 (1-15)
1. MMDDYY 5. MMDDYYYY 9. DDMONYY 13. YYYYMON
2. DDMMYY 6. DDMMYYYY 10. DDMONYYYY 14. MMYYYY
3. YYMMDD 7. YYYYMMDD 11. YYMON 15. MMDDY- Enter an optional description to describe the date recalculation entry.
- Enter the application Screen ID that contains a date input/output field. This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. Type * in this field to find the date on any screen.
- Enter the screen row and column ID location of the screen ID text. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Enter ** (asterisks) in the row field and *** in the column field to indicate that the screen ID can be found anywhere on the screen. If the Screen ID is an * (asterisk), the ID Location must be **,***.
The column of the screen ID location must be the screen column position where the text starts, not the position in front of the text. Use care when typing these values. If the screen ID location is incorrect, no script processing occurs for this entry. - In the Input field number/locn of date field, enter the Input field number, or if the script is recorded in row,column format, the row and column (for example, 3,3) of the input to the screen set on the Screen ID entry. You can use this field in combination with the Screen ID field to tell the script processor to recalculate only certain dates in the script. Enter asterisks (***) to indicate that any input field number can contain a date to recalculate.
Enter blanks in this field to prevent recalculation of any input dates. - In the Output Location of Date field, enter the row and column location of the output date that requires date recalculation. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Enter** for row and *** for column for dates anywhere on the screen.
Enter blanks in this field to prevent recalculation of any output dates. - In the Overlay output area field, specify whether to overlay the screen area if it contains attribute bytes when placing the new date on the screen. Enter Y if the screen area can be overlaid irrespective of its contents. Enter N to reject the request if the output field is not large enough to accept the recalculated date.
- In the Date Separator Character field, specify the character that separates the month, day, and year of the date. For example, for a date of 05/16/07, the date separator character is a slash (/). Enter an asterisk (*) to indicate that the date separator character can vary. If an asterisk is used, the date recalculation function automatically detects the date separator character. Enter N to indicate that no date separator character is used in the date field.
- Specify whether to use Weekdays Only.
- Enter Y to require the recalculated date to be a weekday. If the recalculated date is a Saturday or Sunday, Performance Test changes it to the following Monday.
- Enter N to allow the date to be a weekday or weekend date.
- Enter S if the recalculated date will include Saturday as a weekday (MONDAY through SATURDAY). The weekend date will move ahead to the next Monday.
- Select an Input Script Date Format. Valid input date formats are 1 through 15 (see the Example Date Recalculation Entry to Handle Delivery Date figure). The format you select describes the format of the input date field to be recalculated specifying the order of the day, month, and year date components, and whether the year is two or four characters.
- Select an Output Script Date Format. Valid output date formats are 1 through 15 (see Example Date Recalculation Entry to Handle Delivery Date figure). The format you select describes the format of the recalculated date field, and specifies the format of the date used as input during playback. For example, if the original script had date input fields with two-digit years (as in format 1), but the application was changed to use four-digit years (as in format 5), enter the input date format as 1 and the output date format as 5. This automatically handles the application change from two-digit to four-digit years.
- Press Enter to add the date recalculation entry and remain on the current screen to add more entries. Press END to return to the REXX Script Processor Item List screen and save all added entries in the control file, or press Cancel to return without saving any added entries.
Updating a Date Recalculation entry
To update a date recalculation entry, type U next to the desired item on the Date Recalculation Item List screen and press Enter. The Date Recalculation: UPDATE screen appears.
Date Recalculation: UPDATE screen-------------------------- Date Recalculation: UPDATE -------------------------
Command ===>
END End with save
CANcel End without save
Update optional description . . .
Update the location of the date field:
Screen ID. . . . . . . . . . . . samp
ID Location. . . . . . . . . . . ** , *** (Row,Col)
Input field number/locn of date. *** (For input dates only)
Output location of date. . . . . , (Row,Col). For output dates only.
Overlay output area. . . . . . . (Y/N). For output dates only.
Update other date recalculation options:
Date Separator Character . . . . n (Enter N for no date separator)
Weekdays Only. . . . . . . . . . S (Y/S/N)
Input Script Date Format . 1 (1-15) Output Script Date Format . 1 (1-15)
1. MMDDYY 5. MMDDYYYY 9. DDMONYY 13. YYYYMON
2. DDMMYY 6. DDMMYYYY 10. DDMONYYYY 14. MMYYYY
3. YYMMDD 7. YYYYMMDD 11. YYMON 15. MMDDY
4. YYDDD 8. YYYYDDD 12. MMYY- Press END to update the information in the control file for the selected date recalculation entry and return to the REXX Script Processor Item List screen. Press Cancel to return to the REXX Script Processor Item List screen without updating the entry.
Deleting a Date Recalculation entry
- Type D next to the desired item on the Date Recalculation Item List screen and press Enter to display the Confirm Delete pop-up window (). Use this screen to delete the selected entry.
- Press Enter to delete the information from the control file for the selected date recalculation entry and return to the REXX Script Processor Item List screen. Issue the END primary command to return to the REXX Script Processor Item List screen without deleting the entry.
Browsing a Date Recalculation entry
Type B next to the desired item on the Date Recalculation Item List screen and press Enter to display the Date Recalculation BROWSE screen. Use this screen to browse the selected entry.
Date Recalculation BROWSE screen-------------------------- Date Recalculation: BROWSE -------------------------
Command ===>
END End Browse
Next Browse Next Item
Prev Browse Previous Item
The information in this date recalculation entry is shown below:
Description. . . . . . . . . .
Screen ID. . . . . . . . . . . samp
ID Location. . . . . . . . . . ** , *** (Row,Col)
Input Date flf number/location ***
Output date location . . . . . , (Row,Col)
Overlay output area. . . . . .
Date Separator Character . . . n
Weekdays Only. . . . . . . . . S (Y/S/N)
Input Script Date Format . . . 1 (1-15)
Output Script Date Format. . . 1 (1-15)Press END to return to the REXX Script Processor Item List screen, Next to navigate to the next date recalculation entry in the control file, or Prev to navigate to the previous date recalculation entry in the control file.
Multi-Field Date Recalculation
The multi-field date recalculation function allows you to recalculate input and output dates that span fields, such as when the month, day, and year are contained in different fields. This function is option 5 Multi-Field Date Recalculation on the REXX Script Processor * Primary Options screen. Option 5 displays a list of the currently defined multi-field date control entries.
The multi-field date recalculation function Add, Update, Browse and Delete options work similarly to the REXX date recalculation options. To use these options, enter the name and location of the screen. Asterisks (***) are allowed as wildcards in the location fields, indicating that the screen name can appear anywhere on the output screen.
In addition, you must enter the location of the month field for both input and output dates and the location of at least one, or optionally both, of the day and year fields. This function supports the formats of MM YYYY or MM DD. The format of the month (for example, numeric 1–12 or alphabetic JAN or FEB) and year (two-digit or four-digit) is derived from the value in the script. The Weekday field ensures that the calculated date is a weekday.
On some screens, the position of the date can vary. When a field contains an error, it is possible that only that data field is sent to the terminal for validation. When your application performs validation in this manner, the relative input numbers of the date location (month, day, year) can vary based on the previous input. To compensate for this, reformat your script using row,column format and enter the row and column of the input field, or use multiple entries on the same screen. For example, if the same input date (for month, day, year) can occur in fields 4, 5, and 6 or 5, 6, and 7, all that is required is the creation of two control file entries. One control file searches fields 4, 5 and 6 and the other searches 5, 6, and 7 for input date fields.
Starting Multi-Field Date Recalculation
Select option 5 Multi-Field Date Recalculation from the REXX Script Processor * Primary Options screen and press Enter to display the Multi-Field Date Recalculation Item List screen. This screen shows a list of the existing multi-field date entries stored in the control file. If no entries exist, the message (** none **) appears.
Multi-Field Date Recalculation Item List screen------------------- Multi-Field Date Recalculation Item List ------------------
Option ===> Scroll ===> PAGE
Add Create New Multi-Field Date Items
Line Cmds: U Update D Delete B Browse
Month Day Year Month Day Year
ScreenID Input Input Input output output Output Description
-------------------------------------------------------------------------------
** NONE **
******************************* BOTTOM OF DATA ********************************- Issue the Add primary command or one of the line commands (U)pdate, (D)elete, or (B)rowse.
- The Add primary command displays the Multi-Field Date: ADD screen where you can create new multi-field date entries. If entries already exist, they are listed on this screen. See Adding a Multi-Field Date Entry for details.
- The (U)pdate line command displays the Multi-Field Date: UPDATE screen. See Updating a Multi-Field Date Entry for details.
- The (D)elete line command displays the Confirm Delete screen. See Deleting a Date Recalculation Entry for details.
- The (B)rowse line command displays the Multi-Field Date: BROWSE screen. See Browsing a Multi-Field Date Entry for details.
Adding a Multi-Field Date entry
Type ADD on the Multi-Field Date Recalculation Item List screen and press Enter to display the Multi-Field Date: ADD screen.
Multi-Field Date: ADD screen---------------------------- Multi-Field Date: ADD ----------------------------
Command ===>
ENTER Add item
END End with save of added items
CANcel End without save of added items
Enter Description .
Describe the message and where it is displayed.
Screen ID . . . . *
ID Location . . . 01 , 01 (Row,Col)
Describe Multi-field input date (Required when processing input dates):
Month Position. . Input field number or location ('000' for julian)
Day Position . . Input field number or location
Year Position . . Input field number or location
Describe Multi-field output date (Required when processing output dates):
Month location. . MO , (Row,Col) (Enter 00,000 for Julian)
Day location. . . DA , (Row,Col)
Year location . . YE , (Row,Col)- Enter an optional Description of the multi-field date entry.
- Enter the Screen ID for the screen where the multi-field date is input or shown. This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. Wildcards are not allowed. A wildcard character is treated as the actual screen ID.
- Enter the screen ID Location (screen row and column of the screen ID). Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Enter ** (asterisks) in the row field and *** in the column field to indicate that the screen ID can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts. Do not make any adjustments to account for attribute bytes. For example, if the screen ID is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). In this case, specify 1,2 for the screen ID location fields.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens to be processed, and no script processing will occur for this entry. - Enter the Input dates. The Month Position is required. Either the Day Position or the Year Position is also required, or you can use both if desired.
- Month Position is the field number or row and column location where the month is entered on the input screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Enter 000 to recalculate Julian dates. This field is mandatory when processing input dates.
- Day Position is the field number or row and column location where the day is entered on the input screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Leave input day fields blank if you do not want them processed. This field is optional if the Year Position field is used.
- Year Position is the field number or row and column location where the year is entered on the input screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Leave input year fields blank if you do not want them processed. This field is optional if the Day Location field is used.
Enter the Output dates. The Month Location is required. Either the Day Location or the Year Location is also required, or you can use both if desired.
- Month Location is the field number or row and column location where the month is entered on the output screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Wildcards are not allowed in this field. Enter 00 for row and 000 column numbers to process Julian dates. This field is mandatory when processing output dates.
- Day Location is the field number or row and column location where the day is entered on the output screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Wildcards are not allowed in this field. This field is optional if the Year Location field is used.
- Year Position is the field number or row and column location where the year is entered on the output screen. Valid row numbers are between 1 and 43. Valid column numbers are between 1 and 132. Wildcards are not allowed in this field. This field is optional if the Day Location field is used.
- Specify whether the recalculated date must be a Weekday. Y requires the recalculated date to be a weekday. If the recalculated date is a Saturday or Sunday, Performance Test changes it to the following Monday. N allows the date to be either a weekday or weekend date.
- Press Enter to save the entry, which is stored in the control file when the END key is pressed.
- Press END to exit the ADD screen and save the new entries in the control file or CANCEL to exit the ADD screen without saving new entries.
Updating a Multi-Field Date entry
Type U next to the desired item on the Multi-Field Date Recalculation Item List screen and press Enter to display the Multi-Field Date: UPDATE screen.
Multi-Field Date: Update screen. --------------------------- Multi-Field Date: UPDATE -------------------------- .
. Command ===> .
. .
. END End with save .
. CANcel End without save .
. .
. Optional Description . sample description .
. .
. Update screenid and location: .
. Screen ID . . . . * .
. ID Location . . . ** , *** (Row,Col) .
. .
. Update Multi-field input date info: .
. Month Position. . Input field number or location ('000' for julian) .
. Day Position . . Input field number or location .
. Year Position . . Input field number or location .
. .
. Update Multi-field output date info: .
. Month location. . 10 , 017 (Row,Col) (Enter 00,000 for Julian) .
. Day location. . . 11 , 017 (Row,Col) .
. Year location . . 12 , 017 (Row,Col) .
. .
. Weekday?. . . . . Y Y (yes) / N (no) .- Change the existing multi-field date entries as desired and press Enter.
- Issue the END command to exit the UPDATE screen and save your changes or CANCEL to exit without saving your changes. The field definitions are the same as those described in Adding a Multi-Field Date Entry.
Browsing a Multi-Field Date entry
Type B next to the desired item on the Multi-Field Date Recalculation Item List screen and press Enter to display the Multi-Field Date BROWSE screen. This screen is for viewing only, field information cannot be changed.
Multi-Field Date BROWSE screen. --------------------------- Multi-Field Date: BROWSE -------------------------- .
. Command ===> .
. .
. END End Browse .
. Next Browse Next Item .
. Prev Browse Previous Item .
. .
. The information in this multi-field date entry is shown below: .
. .
. Description. . . . . . . sample description .
. Screen ID. . . . . . . . * .
. ID Location. . . . . . . ** , *** (Row,Col) .
. .
. Month input num/locn . . Input number or location .
. Day input num/locn . . . Input number or location .
. Year input num/locn. . . Input number or location .
. .
. Month output locn. . . . 10 , 017 (Row,Col) .
. Day output locn. . . . . 11 , 017 (Row,Col) .
. Year output locn . . . . 12 , 017 (Row,Col) .
. .
. Weekday? . . . . . . . . Y .- Issue the END command to exit the BROWSE screen, NEXT to view the next date entry in the control file, or PREV to view the previous date entry in the control file.
Deleting a Multi-Field Date entry
- Type D next to the desired item on the Multi-Field Date Recalculation Item List screen and press Enter to display the Multi-Field Date Confirm Delete pop-up window.
Press Enter to delete the entry and remove it from the control file, or press END to exit the Confirm Delete pop-up window without deleting the entry from the control file.
List processing
The REXX script processor list processing function handles situations where the application being tested presents a screen containing a list of rows from which the user can select. The row originally selected during the recording may move to a different location in the list before playback. When this happens, you can use the list processing function to enhance playback so that the script always selects the original row, even if it has moved within the list.
Sample list processing scenario
The following figures provide a sample list processing scenario. During the recording, the user selects member H01AC069 from the application’s ISPF member list screen (see the following figure) by typing an S line command and pressing Enter.
List row selected
------------------------------------------------------------------------------
EDIT CWX0001.RYAN.JCL Row 00024 of 00089
Command ===> Scroll ===> CSR
Name VV MM Created Changed Size Init Mod ID
. EXPAND 01.00 06/11/14 06/11/14 17:23 14 14 0 CWX0001
. FILE501 01.01 05/10/13 06/02/01 10:47 177 177 0 CWX9990
. FILE51 01.00 06/01/27 06/01/27 09:30 177 177 0 CWX0001
. GENERATE 01.01 05/11/17 06/01/23 16:30 55 55 0 CWX0001
. GENMASK 01.00 05/10/20 05/10/20 08:44 3 3 0 CWX0001
. GOOD
. GOOD2
. GTFPRINT 01.03 07/03/12 07/03/27 14:11 18 19 0 CWX0001
. HIPERDC2 01.00 05/09/19 05/09/19 13:26 160 160 0 CWX0001
. HIPERDOC 01.15 05/09/09 05/09/14 10:24 284 194 0 CWX0001
S H01AC069 01.02 05/02/23 07/04/04 11:08 110 76 110 CWX0001
. H01AC139 01.08 06/02/03 07/04/04 12:43 95 102 0 CWX0001
. IDCAMS 01.01 05/08/30 05/08/30 10:56 46 32 0 CWX0001
. IDCAM3 01.06 06/04/04 06/06/13 16:08 20 19 0 CWX0001
However, when this script is later played back, the rows in the member listing screen may have changed. New members may have been added while other members may have been deleted. The script could select a different member from the listing because H01AC069 has moved (see the following figure).
Incorrect row selected during playback
------------------------------------------------------------------------------
EDIT CWX0001.RYAN.JCL Row 00024 of 00089
Command ===> Scroll ===> CSR
Name VV MM Created Changed Size Init Mod ID
. EXPAND 01.00 06/11/14 06/11/14 17:23 14 14 0 CWX0001
. FILE501 01.01 05/10/13 06/02/01 10:47 177 177 0 CWX9990
. FILE51 01.00 06/01/27 06/01/27 09:30 177 177 0 CWX0001
. GENERATE 01.01 05/11/17 06/01/23 16:30 55 55 0 CWX0001
. GENMASK 01.00 05/10/20 05/10/20 08:44 3 3 0 CWX0001
. GTFPRINT 01.03 07/03/12 07/03/27 14:11 18 19 0 CWX0001
. HIPERDC2 01.00 05/09/19 05/09/19 13:26 160 160 0 CWX0001
. HIPERDOC 01.15 05/09/09 05/09/14 10:24 284 194 0 CWX0001
. H01AC069 01.02 05/02/23 07/04/04 11:08 110 76 110 CWX0001
. H01AC139 01.08 06/02/03 07/04/04 12:43 95 102 0 CWX0001
S IDCAMS 01.01 05/08/30 05/08/30 10:56 46 32 0 CWX0001
. IDCAM3 01.06 06/04/04 06/06/13 16:08 20 19 0 CWX0001
. IEBCOPY 01.32 05/08/30 07/09/26 15:00 27 53 0 CWX0001
. IEBGENER 01.62 05/04/29 07/09/09 15:31 14 12 0 CWX0001
The list processing function adds logic to the script so that when it is played back, Performance Test looks through the list rows for the original row. The script processor does this by looking at each row in the listing and matching it with what was originally selected. If the original row is not found on the page, the list processing logic scrolls to the next page and continues searching. If the original row is not found anywhere in the list, the script shows an error message and playback stops.
Starting list processing
Type 3 on the REXX Script Processor * Primary Options screen and press Enter to display the REXX Script Processor * List Processing screen. This screen prepares the script processor to write list processing REXX logic into scripts. If the control file already contains list processing entries, they appear on this screen.
REXX Script Processor * List Processing screen. ------------------- REXX Script Processor * List Processing ------------------- .
. Option ===> Scroll ===> PAGE .
. .
. Add Create New List Processing Entries .
. .
. Line Cmds: U Update D Delete B Browse .
. .
. .
. List Key Key .
. Screen ID Type Column Length Description .
. ------------------------------------------------------------------------------- .
. ** NONE ** .
. ******************************* BOTTOM OF DATA ******************************** .The Key Column is the screen column location of the key. The key is the data in the list row that uniquely marks each row. Key Length is the Number of characters that make up the key.
- Issue the Add primary command or one of the line commands (U)pdate, (D)elete, or (B)rowse.
- The Add primary command displays the List Processing: ADD screen where you can create new list processing entries. See Adding a List Processing Entry for details.
- The (U)pdate line command displays the REXX Script Processor * List Processing UPDATE screen. See Updating a List Processing Entry for details.
- The (D)elete line command displays the Confirm Delete screen. See Deleting a List Processing Entry for details.
- The (B)rowse line command displays the REXX Script Processor * List Processing BROWSE screen. See Browsing a List Processing Entry for details.
Adding a List Processing entry
Type ADD on the REXX Script Processor * List Processing screen command line and press Enter to display the List Processing: ADD screen and add a new list processing entry.
List Processing: ADD screen. ----------------------------- List Processing: ADD ---------------------------- .
. Command ===> .
. .
. ENTER Add item .
. END End with save of added items .
. CANcel End without save of added items .
. .
. Enter optional list processing entry description: .
. Description . . . .
. Describe the list screen: .
. Screen ID . . . . .
. ID Location . . . ** , ** (Row,Column) .
. List Location . . , (Top Row,Bottom Row) .
. Scroll Pfkeys . . PF7 , PF8 (Up,Down) .
. Selection Pfkey . .
. Key Location. . . , (Column,Length) .
. List Type . . . . 1 (1-2) 1. Cursor Select 2. Line Command Select .
. End of List ID. . 1 (1-4) .
. 1. Scrolling Stops 2. Blank Key 3. NN/NN (Current Page/Total Pages) .
. 4. End Of List Text .
. Enter processing parameters for End of List ID = 3: .
. SAP format (Y/N) .
. Current page Row Col Len Total page Row Col Len .
. .- Enter an optional Description to describe the list processing entry.
- Enter the Screen ID for the application screen that contains the list. This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
- Enter the ID Location. This is the screen row and column location of the screen ID text. Enter ** (asterisks) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts. Do not make any adjustments to account for attribute bytes. For example, if the screen ID is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). In this case, specify 1,2 for the screen ID location fields.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens to be processed, and no script processing will occur for this entry. - Enter the List Location on the screen where the list rows appear. The two list location fields are the top row and bottom row fields. Enter the row number of the first row in the list in the top row field and the row number of the last row in the list in the bottom row field.
- Enter the Scroll PFkeys that you want to use to page up/back and down/forward through the list. Type the PF key used to scroll backward in the Up field, and type the PF key used to scroll forward in the Down field.
- Enter the Selection Pfkey you will use when selecting a row from the list. For example, if you select a row by typing S and pressing Enter, then Enter is the selection PF key.
- Enter the Key Location. The key is the data in the list row that uniquely marks each row. Type the screen column location of the key in the key column field, and the number of characters in the key in the key length field. For example, the key used for the member listing scenario is the member name itself. The member name appears starting in column 4 with a length of 8.
The key location can be entered as an absolute number (01 to 99) or as a relative number (+1 to +9). The relative number represents the relative position from the selected command position to the key, and can be used for multiple-column key lists. - Enter the End Of List ID (the number of one of the four following options) to specify what happens when the end of the list is reached when scrolling forward:
- 1. Scrolling Stops: When you reach the end of the list, scrolling forward repeatedly shows the same screen.
- 2. Blank Key: The end of the list can be determined when the “key” is empty (a blank row).
- 3. NN/NN: The end of the list is a current page/total page counter. This is commonly found on list screens in SAP applications. If you use this option, review the current page and total page parameters in member HSCMnnnn from the common PARMLIB. These parameters are described in the Performance Test Advanced-Configuration-Guide. If the specification for these parameters is not SAP format, they can be entered on this screen.
- 4. End-of-List Text: The end of the list is when you reach the text typed in the End-of-List Text field. Be sure to correctly match the uppercase and lowercase characters.
- Enter the type of lists that can be handled by the script processor:
- Cursor Select: Select the row by placing the cursor on the desired row and pressing a PF key.
- Line Command Select: Select the row by placing data in an input field on the desired row. For example, type S in a field to select the row. The list processing function does not handle multiple line commands. If you type S in lines 9, 10, and 13 to select all three rows, the list processing function selects only the first row.
- Leave the command line blank and press Enter to add the list processing entry and remain on the current screen to add additional entries. Press END to return to the REXX Script Processor * List Processing screen and save all added entries in the control file. Press Cancel to return to the REXX Script Processor * List Processing screen without saving added entries.
Updating a List Processing entry
Type U next to the desired item on the REXX Script Processor * List Processing screen and press Enter to display the REXX Script Processor * List Processing UPDATE screen and update the selected entry.
REXX Script Processor * List Processing UPDATE screen. ---------------- REXX Script Processor * List Processing UPDATE --------------- .
. Command ===> .
. .
. Cancel End Update Without Save .
. END Update Entry .
. .
. Update optional list processing entry description: .
. Description . . . sample description .
. Update the list screen description: .
. Screen ID . . . . * .
. ID Location . . . ** , ** (Row,Column) .
. List Location . . 10 , 20 (Top Row,Bottom Row) .
. Scroll Pfkeys . . PF7 , PF8 (Up,Down) .
. Selection Pfkey . ENTER .
. Key Location. . . 07 , 20 (Column,Length) .
. List Type . . . . 1 (1-2) 1. Cursor Select 2. Line Command Select .
. End of List ID. . 3 (1-4) .
. 1. Scrolling Stops 2. Blank Key 3. NN/NN (Current Page/Total Pages) .
. 4. End Of List Text .
. Update processing parameters for End of List ID = 3: .
. SAP format Y (Y/N) .
. Current page Row Col Len Total page Row Col Len .- Press END to update the information in the control file for the selected list processing entry and return to the Performance Test REXX Script Processor * List Processing screen or Cancel to return to the Performance Test REXX Script Processor * List Processing screen without updating the entry.
Deleting a List Processing entry
- Type D next to the desired item on the REXX Script Processor * List Processing screen and press Enter to display the Confirm Delete pop-up window.
- Press Enter to delete the information from the control file for the selected list processing entry and return to the Performance Test REXX Script Processor * List Processing screen or END to return to the Performance Test REXX Script Processor * List Processing screen without deleting the entry.
Browsing a List Processing entry
Type B next to the desired item on the REXX Script Processor * List Processing screen and press Enter to display the REXX Script Processor *List Processing BROWSE screen. Field information can only be viewed, not changed, on the Browse screen.
REXX Script Processor List Processing BROWSE screen. ---------------- REXX Script Processor * List Processing BROWSE --------------- .
. Command ===> .
. .
. END End Browse .
. Next Browse Next Entry .
. Prev Browse Previous Entry .
. .
. The information in this list processing entry is shown below: .
. .
. Description . . . . . . SAMPLE DESCRIPTION .
. Screen ID . . . . . . . * .
. ID Location . . . . . . ** , ** (Row,Col) .
. List Location . . . . . 10 , 20 (Top Row,Bottom Row) .
. Scroll Pfkeys . . . . . PF7 , PF8 (Up,Down) .
. Selection Pfkey . . . . ENTER .
. Key Location. . . . . . 07 , 20 (Col,Length) .
. End Of List ID. . . . . 3 (1-4) .
. End Of List Text. . . . .
. NN/NN Specification . .SAP -- Current Page / Total Pages -- .
. Y .
. List Type . . . . . . . CURSOR SELECT .Use the END, Next, or Prev primary command to view another processing entry or return to the REXX Script Processor * List Processing screen.
- END returns to the REXX Script Processor * List Processing screen.
- Next shows the next list processing entry in the control file.
- Prev shows the previous list processing entry in the control file.
Synchronization
The REXX script processor notes situations where the application being tested unexpectedly generates messages (such as ‘Processing...’) that say it is busy or blocked. If these messages appear during recording and not during playback, or vice versa, playback can get out of sync with the application. The REXX script processor notes these messages in the recorded script and as playback runs. When such a message is encountered, the script takes the appropriate action to handle the message and stay in sync with the application being tested.
For example, a user records herself doing an inquiry. When the application processes the inquiry, if the response time is good the next screen appears immediately. But if the system is busy, the application responds with the message PLEASE WAIT, as shown at the bottom of the following figure, and the user’s terminal is free for input. Continue to press Enter until the PLEASE WAIT message disappears and the inquiry is complete.
PLEASE WAIT Message
INQ - ENTER FUNCTION CODE
11111 - ENTER EMPLOYEE NUMBER (OPTIONAL FOR BROWSE)
*** COMPUWARE CORPORATION ***
CICS PLAYBACK/FX DB2 SAMPLE TRANSACTION
VALID FUNCTIONS CODES ARE:
INQ (INQUIRE), UPD (UPDATE), ADD (ADD), DEL (DELETE), BRO (BROWSE)
SOME VALID EMPLOYEE NUMBERS ARE:
11111, 22222, 33333, 44444, 55555
DATE: 07.235
TIME: 11:08:58
MSG100 - PLEASE WAIT WHILE PROCESSING INQUIRY
If the message appears during inquiry processing, you may have to press Enter five times before the inquiry is complete. Or, you may press Enter nine times but the message may never appear at all. When the recorded script differs from the script that is played back, playback can easily get out of sync.
The synchronization function solves this problem by first removing the “extra” Enter keys from the recording, and then inserting REXX code into the script to handle the Enter keys in case the message appears during playback.
Starting synchronization
Select option 4 Synchronization on the REXX Script Processor * Primary Options screen, and press Enter to display the REXX Script Processor * Synchronization screen. On this screen you can set up the script processor for writing synchronization REXX logic into your scripts.
If the control file already contains synchronization entries, they appear on the REXX Script Processor * Synchronization screen.
The REXX code to perform the synchronization is added to the output script. The code is constantly executed during playback. Use caution when creating synchronization entries. More entries in the control file create more REXX code in the output script. Unnecessary synchronization entries in the control file create unnecessary CPU usage when the script is played back.
REXX Script Processor Synchronization screen. ------------------- REXX Script Processor * Synchronization ------------------- .
. Option ===> Scroll ===> PAGE .
. .
. Add Create New Synchronization Entries .
. .
. Perform synchronization prior to each input message .
. .
. Line Cmds: U Update D Delete B Browse .
. .
. Message .
. Message Text Location Action Description .
. ------------------------------------------------------------------------------- .
. ** NONE ** .
. ******************************* BOTTOM OF DATA ******************************** .- Issue the Add primary command or one of the line commands (U)pdate, (D)elete, or (B)rowse.
- The Add primary command displays the REXX Script Processor * Synchronization screen where you can create new synchronization entries. See Adding a Synchronization Entry for details.
- The (U)pdate line command displays the REXX Script Processor * Synchronization UPDATE screen. See Updating a Synchronization Entry for details.
- The (D)elete line command displays the Confirm Delete screen. See Deleting a Synchronization Entry for details.
- The (B)rowse line command displays the REXX Script Processor * Synchronization BROWSE screen. See Browsing a Synchronization Entry for details.
- When you select Perform synchronization prior to each input message, the script processor places an <ADDCALL> statement at the beginning of the script, forcing synchronization processing to be performed prior to each input message. This is useful for applications like SAP where the point of synchronization is not known until script execution time. When this option is not selected, the script processor adds synchronization calls to the script based on the synchronization entries. Type a slash to select this option.
Adding a synchronization entry
Type ADD on the Option line on the REXX Script Processor * Synchronization screen and press Enter to display the Synchronization: ADD screen.For the script processor to handle the PLEASE WAIT scenario, you must add a synchronization entry (such as the one shown below) to the control file.
REXX script processor Synchronization ADD screen. ----------------------------- Synchronization: ADD ---------------------------- .
. Command ===> .
. .
. ENTER Add item .
. END End with save of added items .
. CANcel End without save of added items .
. .
. Enter optional synchronization entry description: .
. Description . . . . .
. .
. Describe the message and where it is displayed: .
. Screen ID . . . . . * .
. ID Location . . . . ** , ** (Row,Col) .
. Message Text. . . . .
. Message Location. . ** , ** (Row,Col) .
. .
. Describe the action to take when the message is displayed: .
. Action To Take. . . . . ENTER .
. Max Times To Repeat . . 99 .
. Delay Time Amount . . . 00 : 00 (mm:ss) .- Enter an optional Description to describe the synchronization entry.
- Enter a Screen ID if you want the script processor to respond to a message only when it appears on a specific screen. This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly.
- Enter the ID Location (screen row and column) of the screen ID text. Enter asterisks (**) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts. Do not make any adjustments to account for attribute bytes. For example, if the screen ID is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). In this case, specify 1,2 for the screen ID location fields.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens to be processed, and no script processing will occur for this entry. - Enter the Message Text indicating that the system is busy or blocked. The message text is case sensitive, so match the uppercase and lowercase characters with the characters generated in the application message.
- Enter the Message Location (screen row and column) of the message text. The column of the message location must be the screen column position where the text starts. Do not make any adjustments to account for attribute bytes. Use care when typing these values. If the message location is incorrect, no script processing occurs for this entry. Enter asterisks (**) in the row and column fields to indicate that the message text can be found anywhere on the screen.
- Enter the Action To Take when the message is encountered. Valid options include:
- AID Key: If the action is to press an AID key such as Enter, Clear, or PF6, type the AID key in the Action To Take field.
- WAIT: If the action is to wait for a set amount of time without pressing a key, type WAIT in the Action To Take field.
- REPEAT: If the action is to repeat the previous AID key, type REPEAT in the Action To Take field.
- Enter the maximum number of times to repeat the action if the message is encountered during playback in the Max Times To Repeat field. The Action To Take repeats until the message is gone. Entering 0 in this field sets no limit to the number of times the action is repeated.
- Set a Delay Time Amount for when the value in the Action To Take field is WAIT. This sets how long playback waits when the message is encountered. If the action is REPEAT or an AID key, you can use the delay time to pause before taking the action. For example, if the Delay Time amount is 00,15, playback pauses for 15 seconds before the action is taken.
- 1 Press Enter to add the synchronization entry and remain on the current screen to add more entries or END to return to the REXX Script Processor * Synchronization screen and save all added entries in the control file. Enter CANcel to return to the REXX Script Processor * Synchronization screen without saving any added entries.
Updating a Synchronization entry
Type U next to the desired item on the REXX Script Processor * Synchronization screen, and press Enter to display the REXX Script Processor * Synchronization UPDATE screen.
REXX Script Processor Synchronization UPDATE screen. ---------------- REXX Script Processor * Synchronization UPDATE --------------- .
. Command ===> .
. .
. Cancel End Update Without Save .
. END Update Entry .
. .
. Update optional synchronization entry description: .
. Description . . . . sample description .
. .
. Update the message and where it is displayed: .
. Screen ID . . . . . * .
. ID Location . . . . ** , ** (Row,Col) .
. Message Text. . . . please wait .
. Message Location. . ** , ** (Row,Col) .
. .
. Update the action to take when the message is displayed: .
. Action To Take. . . . . ENTER .
. Max Times To Repeat . . 025 .
. Delay Time Amount . . . 00 : 10 (mm:ss) .- Enter END to update the information in the control file for the selected synchronization entry and return to the REXX Script Processor * Synchronization screen. Enter Cancel to return to the REXX Script Processor * Synchronization screen without updating the entry. The field definitions for this screen are the same as those for the Synchronization: ADD screen.
Deleting a Synchronization entry
- To delete an entry, type D next to the desired item on the REXX Script Processor * Synchronization screen. The Confirm Delete pop-up window will appear.
- Press Enter to delete the information from the control file for the selected synchronization entry and return to the REXX Script Processor * Synchronization screen or END to return to the REXX Script Processor * Synchronization screen without deleting the entry.
Browsing a Synchronization entry
To browse a synchronization entry, type B next to the desired item on the REXX Script Processor * Synchronization screen, and press Enter to display the REXX Script Processor * Synchronization BROWSE screen.
REXX Script Processor Synchronization BROWSE screen. ---------------- REXX Script Processor * Synchronization BROWSE --------------- .
. Command ===> .
. .
. END End Browse .
. Next Browse Next Entry .
. Prev Browse Previous Entry .
. .
. The information in this synchronization entry is shown below: .
. .
. Description . . . . . . SAMPLE DESCRIPTION .
. Screen ID . . . . . . . * .
. ID Location . . . . . . ** , ** (Row,Col) .
. Message Text. . . . . . PLEASE WAIT .
. Message Location. . . . ** , ** (Row,Col) .
. Action To Take. . . . . ENTER .
. Max Times To Repeat . . 025 .
. Delay Time Amount . . . 00 : 10 (mm:ss) .Press END to return to the REXX Script Processor * Synchronization screen. Press Next to show the next synchronization entry in the control file. Press Prev to show the previous synchronization entry in the control file.
Running the REXX Script Processor
After a script is recorded and the appropriate entries are made and saved in the control file, you are ready to run the REXX script processor.
Enter GO on the Option line on the REXX Script Processor * Primary Options screen. The Script Processor * Execution screen appears.
Script Processor * Execution screen. ------------------------- Script Processor * Execution ------------------------ .
. Command ===> .
. .
. blank Continue .
. .
. Type the names of the script data sets below, then press Enter key .
. Do not specify the script/member name .
. .
. Input Script Data Set: .
. Project . . . .
. Group . . . . .
. Type . . . . .
. .
. Other Partitioned Data Set: .
. Data Set Name . . . 'PMIJSS0.HIPER.VTAM.SCRIPTS' .
. .
. Output Script Data Set: .
. Project . . . .
. Group . . . . .
. Type . . . . .
. Other Partitioned Data Set: .
. Data Set Name . . . 'PMIJSS0.HIPER.VTAM.SCRIPTS.OUTPUT' .- Enter the name of the data set (not including the member) that contains your recorded Performance Test scripts in the Input Script Data Set field.
Enter the name of the data set (not including the member) used to store the new “processed” scripts in the Output Script Dataset field.
Press Enter to continue. The Script Processor * Execution screen appears.
List Script Names for Processing. ------------------------- Script Processor * Execution ------------------------ .
. Option ===> .
. .
. F Initiate Processing In Foreground. .
. B Initiate Processing In Background. .
. .
. Input Script Data Set: 'PMIJSS0.HIPER.VTAM.SCRIPTS' .
. Output Script Data Set: 'PMIJSS0.HIPER.VTAM.SCRIPTS.OUTPUT' .
. .
. INPUT SCRIPT NAME OUTPUT SCRIPT NAME .
. SAMP0000 SAMP0000 .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. Replace Existing Members . . . Y (Y/N) .The input and output script data set names are prefilled from the previous screen and cannot be changed.
- Enter the member names of the recorded Performance Test scripts to process in the Input Script Name column. Enter an asterisk (*) as the script name to process all members in the data set.
- Enter the member names of the new scripts to be created by the script processor in the Output Script Name column. There must be an output script name for every input script name. If you use the same name for both the input and output scripts, the script processor will overwrite the original script. If you enter an asterisk (*) as the input script name, you must also use an asterisk as the output script name.
- Specify whether to Replace Existing Members if an output script already exists. Enter Y to overwrite existing scripts.
- Enter F or B on the Option line and press Enter to begin. F starts the script processor in TSO foreground. B runs the script processor in the background (batch) freeing your terminal while the script processor runs.
Background (Batch) Execution
Type B on the Script Processor * Execution screen, and press Enter. The Script Processor * Background Execution screen appears.
Script Processor Background Execution screen. ------------------- Script Processor * Background Execution ------------------- .
. Command ===> .
. .
. Go To generate and display the JCL .
. End To Exit without submitting .
. .
. Specify jobcard information: .
. // .
. // .
. // .
. // .
. .
. Sysout Class For Output Messages . . . * .
. .You must supply the script processor with JCL job statements for it to run in background mode.
- Type the job statements in the jobcard information area and enter the Go command. This displays the JCL in edit mode.
- To submit the JCL immediately, enter SUB on the command line. Background processing starts and the Script Processors screen reappears.
When the script processor builds the background job JCL, it obtains information from member HSCMnnnn from the common PARMLIB. Refer to the Performance Test Advanced-Configuration-Guide for information on parameters in member HSCMnnnn from the common PARMLIB. - Enter the Sysout Class For Output Messages. The script processor generates some messages to describe the successful execution and/or errors encountered during script processing. The messages are written to the SYSOUT queue listed by this field.
- Press END to exit the Script Processor * Background Execution screen without submitting the JCL.
Processed script REXX structures
The REXX script processor produces Performance Test output scripts that contain REXX code. This section describes the layout of the various REXX instructions and routines that can be imbedded in the output script.
Data replacement REXX
There are two parts to data replacement. The first part obtains the data from the system-generated field on the chosen application screen. The second part uses that data as input later in the script. The data generated during playback replaces the original input data.
When a data replacement entry is created, you define the screen where the system-generated field appears. When the REXX script processor runs and finds this “from” screen, it inserts REXX instructions after it in the output script. Basically, the REXX instructions get the data in the system-generated field off the screen and store it in an array variable called SYSTEM_FIELD.
The following figure provides a REXX example that stores a “from” field in the variable SYSTEM_FIELD.1.
Data Replacement REXX Storing “From” Field
<S17>. .Ter(EP03) .Pri(.000.).Pag.Ins.Ati.Tti. .
<S18>......Net(H01AD03T).Rel. .
<S19>.+.Ter(EP04) .Pri(.000.).Pag.Ins.Ati.Tti. .
<S20>......Net(H01AD04T).Rel. .
<S21>
<S22>......................................................SYSID=C054.APPLID=H01
<S23>...RESPONSE:.NORMAL.............................TIME: 10.59.50 DATE: 05.2
<S24>.PF.1.HELP.......3.END....................7.SBH.8.SFH.9.MSG.10.SB.11.SF.
</OUTPUT>
/*********************************************************/
/* Data replacement REXX inserted 10 May 2007-13:15:12 */
/*********************************************************/
row = 23
col = 56
len = 08
system_field.1 = SUBSTR(screen,(row-1)*80+col,len)
<INPUT>0000007
<THINK>01.57.331 AT 00:02:20.421
When the REXX script processor finds an input field value that matches the original “from” field value, it replaces that input with the matching variable name (see the following figure).
Data Replacement REXX, Replaced Input Field
<INPUT>0000012
<THINK>00.07.960 AT 00:02:51.723
<KEY>ENTER
<CURSOR>10,32
<I01>system_field.1
<I02>"000.00"
<I03>"000.00"
</INPUT>
Date Recalculation REXX
When the REXX script processor produces a script that contains date recalculation REXX, REXX instructions are inserted in several places.
REXX is first added in the beginning of the script where the variable SCRIPT_BASE initializes. This variable contains a date base (number of days elapsed since 01/01/0001) that represents the date the original script was recorded.
Variable Script_Base
* CREATED BY USER: USER25 TPF: TSO TIME: 11:26 DATE: 01/15/07
* DESC:
********************************************************************
<VERSION>7
/*******************************************************************
/* Date recalculation REXX inserted 15 Jan 2007 09:16:30
/*******************************************************************
script_base = 729769
REXX instructions are also added where an input and/or output date field is found in the original script. The original date value is replaced with a REXX variable that is recalculated during playback. Prior to using the out_date variable, the REXX statements to call the date recalculation routine (SPDTCALC) are added to the script.
SPDTCALC - Date Recalculation Function
/* Date recalculation REXX inserted 22 Jan 2007 16:25:21
/*******************************************************************
out_date = SPDTCALC(’DATE’,’5’,’N’,’1’,’/’)
<I01>out_date
<I02>"John smith"
<I03>"000.00"
</INPUT>
The SPDTCALC function uses the following information to calculate a new date in the requested format. A brief description of each follows.
- Return type
- Difference
- Weekday only indicator
- Date format
- Date separator character
Return type
Tells the SPDTCALC function what to return.
Format | Description |
|---|---|
DATE | Return date in the chosen format |
MM | Return 2 digit numeric month (01 through 12) |
DD | Return 2 digit day (01 through 31) |
YY | Return 2 digit year (01 through 99) |
MON | Return 3 character alpha month (JAN, FEB,…DEC) |
DDD | Return 3 digit julian day (001 through 366) |
CCYY | Return 4 digit year (0001 through 9999) |
Difference
This is the number of days between the script creation date and the actual date being recalculated. SPDTCALC applies this difference to the current date to get the new date.
Weekday only indicator
Indicates whether the returned date must be a weekday.
Indicator | Description |
|---|---|
Y | The returned date must be a weekday (Monday through Friday). Weekend date moves ahead to the next Monday. |
N | The returned date need not be a weekday. In this case, the returned date could be any day (Sunday through Saturday). |
Date format
Determines the format for the returned date. This is required only for DATE type.
Date separator character
The character that separates year, month, and day for the returned date. It is required only for DATE type.
Finally, the script processor creates the external REXX function SPDTCALC. It is placed in the same data set where the output script is created.
Sample Input Date Recalculation REXX Code
<BASETIME>09/18/06 11:26:51.888
<INPUT>0000002
<THINK>00.03.229 AT 00:00:00.000
<KEY>ENTER
<CURSOR>03,14
/*******************************************************************
/* Date recalculation REXX inserted 22 Jan 2007 16:25:21
/*******************************************************************
out_date = SPDTCALC(’DATE’,’5’,’N’,’1’,’/’)
<I01>out_date
</INPUT>
As you can see in the following figure, the script processor replaces the actual date in the input field with a REXX variable (for example, out_date). This variable is initialized and creates a new date value during playback by invoking the SPDTCALC REXX function.
Sample Output Date Recalculation REXX Code
/* Date recalculation REXX inserted 22 Jan 2007 16:56:04
/*******************************************************************
DV1=SPDTCALC(’DATE’,’15’,’N’,’1’,’/’) /* Date=01/31/07 Col=01
S07=’<S07> Date: ’||,
DV1||,
’ Date of shipment’
<OUTPUT>0000001
<RESPONSE>00.00.346
<S01>
<S02>
<S03>
<S04>
<S05> Name: John Smith
<S06>
<ALTER>S07
<S07> Date: 01/31/07 Date of shipment
<S08>
<S00>
<S11>
<S12>
<S13> Month: 01 Month of shipment
<S14>
<S15> Day : 31 Day of shipment
<S16>
<S17> Year : 07 Year of shipment
<S18>
<S10>
<S20>
<S21>
<S22>
<S23>
<S24>
</OUTPUT>
When the REXX script processor produces a script that contains output from date recalculation, REXX instructions are inserted in several places:
- Just before the <OUTPUT> card, the following REXX statements, that contains dates selected for recalculation, are added:
- One REXX variable is set up for every date value found in a screen row. This REXX variable is defined to run the SPDTCALC function and return the new date during playback. Note that the original date and its starting column number are placed as a comment at the end for easy reference.
- One REXX assignment statement is inserted for every screen row that contains dates for recalculation. This assignment statement builds a string from the original screen row by replacing all date values with REXX variables. Note that the screen row is broken into multiple lines at date positions.
- Just before the screen row that contains a date, an <ALTER> card selected for recalculation is inserted. During playback, the <ALTER> card replaces the original screen row with the contents of the variable shown on the <ALTER> card.
The following figure shows the contents of the SPDTCALC REXX function.
Contents of the SPDTCALC REXX function
/* Member : SPDTCALC */
/* Created on: 19 Jan 2007 */
/* Created by: Hiperstation Script Processor */
/* */
/* DESCRIPTION: */
/* */
/* This member is a REXX program used to perform date */
/* recalculation. It is called by the Hiperstation */
/* Script processor. It utilizes the following REXX */
/* functions supplied by Hiperstation: */
/* */
/* 1. SPBASE - returns base for a given date */
/* 2. SPDATE - returns date for a given base */
/* */
/* DIRECTIONS: */
/* */
/* DO NOT modify the contents of this REXX program. */
/************************************************************/
ARG date_type,difference,wkday_only,date_format,date_sep
UPPER date_type wkday_only
CALL dateset /* Get today’s date*/
PARSE VAR result day ’/’ month ’/’ year /* Break it down */
today_base = SPBASE(year,month,day) /* Convert to base */
new_base = today_base + difference /* Add difference */
/* Call SPDATE function to convert new base to date */
SELECT
WHEN date_type = ’DATE’ THEN /* get date */
ret_value = SPDATE(new_base,wkday_only,date_format,date_sep)
WHEN date_type = ’MM’ THEN /* get numeric month */
ret_value = SPDATE(new_base,wkday_only,’28’,’N’)
WHEN date_type = ’MON’ THEN /* get alpha month */
ret_value = SPDATE(new_base,wkday_only,’29’,’N’)
WHEN date_type = ’DD’ THEN /* get 2 digit day */
ret_value = SPDATE(new_base,wkday_only,’31’,’N’)
WHEN date_type = ’DDD’ THEN /* get julian day */
ret_value = SPDATE(new_base,wkday_only,’32’,’N’)
WHEN date_type = ’YY’ THEN /* get 2 digit year */
ret_value = SPDATE(new_base,wkday_only,’27’,’N’)
WHEN date_type = ’CCYY’ THEN /* get 4 digit year */
ret_value = SPDATE(new_base,wkday_only,’26’,’N’)
OTHERWISE
DO
SAY ’Incorrect call to routine SPDTCALC’
EXIT
END
END
RETURN ret_value
User-defined current Date Recalculation REXX
Performance Test writes a DATESET script to your script data set in addition to the scripts processed using the REXX script processor. The DATESET script is a REXX routine that returns the system date, if no modifications are made, but allows you to set the current date by setting the MONTH, DAY, and YEAR variables in it. An example is shown in the following figure.
Date Recalculation REXX, Example DATASET Routine
/* NOTE: There is no validation performed on */
/* the date values you enter. Make sure you */
/* enter a valid date. */
/***********************************************/
MONTH = ’01’
DAY = ’15’
YEAR = ’2007’
/******************************************/
/* DO NOT MODIFY ANYTHING BELOW THIS LINE */
/******************************************/
IF MONTH = ’’ THEN
DO
dt_string = DATE(’S’)
YEAR = SUBSTR(dt_string,1,4)
MONTH = SUBSTR(dt_string,5,2)
DAY = SUBSTR(dt_string,7,2)
END
RETURN_VALUE = day||’/’||month||’/’||year
In the preceding figure, the DATESET routine returns 01/15/2007 as the current date. If the values for MONTH, DAY, and YEAR are not set, the system date is returned.
List Processing REXX
When the REXX script processor processes a list processing entry, it takes two actions. First, it removes the original screens associated with the list from the script. It then fills that gap with a REXX instruction that calls a routine to perform the list selection.
The script processor inserts a call statement at the place in the script where the original list selection was made during the recording. The call instruction passes the REXX list processor key, which marks the row originally selected.
The following figure is an example of the list processing REXX. This example shows a list of members listed by ISPF when editing a data set. The key is the member name, ‘H01AC069’.
List Processing REXX, Call to List Routine
/*********************************************************/
/* List Processing REXX inserted 10 May 2007-17:22:27 */
/*********************************************************/
CALL process_list1 ’H01AC069’
<OUTPUT>0000004
<RESPONSE>00.00.660
The script processor then adds the list selection routines at the end of the script (see the following figure). The code in this routine vary depending on the information in the list processing entry.
List Processing REXX, Example List Selection Routine
/*********************************************************/
/* List Processing REXX inserted 10 May 2007-17:22:27 */
/*********************************************************/
process_list1:
ARG match_key
top_row = ’6’
bottom_row = ’24’
row_ctr = top_row - 1
DO FOREVER
CALL format_the_screen
row_ctr = row_ctr + 1
row_text=SUBSTR(the_screen,(row_ctr-1)*columns+1,columns)
key = SUBSTR(row_text,04,08)
IF key = match_key THEN
DO
row_ctr = row_ctr + 1
LEAVE
END
IF row_ctr >= bottom_row THEN
DO
liststart = (top_row - 1) * columns + 1
listend = bottom_row * columns
curr_list=SUBSTR(the_screen,liststart,listend-liststart)
IF curr_list = prev_list THEN
DO
SAY ’ERROR: Original list selection not found’
SAY ’ Original row was ’||match_key
EXIT
END
ELSE
DO
row_ctr = top_row - 1
prev_list = curr_list
<INPUT>
<KEY>PF8
</INPUT>
END
END
END
line_cmd = "s"
<INPUT>0000009
<EXECUTE>"<I("||row_ctr||",2)>"line_cmd
<KEY>ENTER
</INPUT>
RETURN
format_the_screen:
the_screen = ’’
DO text_ctr = 1 TO LENGTH(screen)
char = SUBSTR(screen,text_ctr,1)
IF char < ’40’x THEN
char = ’ ’
the_screen = the_screen||char
END
RETURN
Synchronization REXX
When the REXX script processor processes a synchronization entry, it must handle occurrences of the application message in the recording and during playback.
The script processor handles occurrences of the message that appeared during the recording by deleting those “extra” sections. If the original script shows a user pressing Enter repeatedly because of a particular application message, the script processor deletes those input and output sections in the output script.
In case the application message appears during playback, REXX code is imbedded in the output script to handle it. This is achieved by inserting an <ADDCALL> statement in the beginning of the output script (see the following figure). This <ADDCALL> statement continuously runs a routine called SYNCH_HANDLE during playback.
Synchronization REXX, <ADDCALL> Statement
* CREATED BY USER: CWX0001 TPF: H01AC054 TIME: 10:58 DATE: 05/01/07 *
* DESC: *
************************************************************************
<VERSION>7
/*********************************************************/
/* Synchronization REXX inserted 10 May 2007-13:15:12 */
/*********************************************************/
synch_handle_ctr1 = 0
<ADDCALL>synch_handle
<OUTPUT>0000001
<RESPONSE>00.00.020
SYNCH_HANDLE is a REXX routine located at the end of the script, generated by the synchronization script processor. It contains the logic to correctly identify the message if it appears, and takes the appropriate action to get past it and stay in sync with the application being tested. The following figure is an example routine that looks for the message “PROCESSING.....” If the routine finds this message anywhere on the screen, then it sends the Enter command until the message no longer appears.
Synchronization REXX, Example SYNCH_HANDLE Routing
/* Synchronization REXX inserted 1 May 2007-13:15:12 */
/*********************************************************/
EXIT
synch_handle:
CALL format_the_screen
max_synch_handle_ctr1 = 025
IF POS(’PROCESSING...’,the_screen) > 0 THEN
DO
IF synch_handle_ctr1 > max_synch_handle_ctr1 THEN
DO
SAY ’REACHED MAX REPEAT COUNTER’
RETURN
END
synch_handle_ctr1 = synch_handle_ctr1 + 1
<WAIT> 00,0
<DELCALL>
<INPUT>
<KEY>ENTER
</INPUT>
<OUTPUT>
</OUTPUT>
CALL synch_handle
RETURN
END
synch_handle_ctr1 = 0
RETURN
format_the_screen:
the_screen = ’’
DO text_ctr = 1 TO LENGTH(screen)
char = SUBSTR(screen,text_ctr,1)
IF char < ’40’x THEN
char = ’ ’
the_screen = the_screen||char
END
RETURN
Troubleshooting REXX script processor problems
The following examples document some problems that can occur when using the REXX script processor and their resolutions.
Data replacement
If data replacement processing results in the message:
then the following items can help determine why nothing happened.
Screen ID text
This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. If the text does not match exactly, the script processor will not recognize the screens that require processing. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
Screen ID location
Screen row and column location of the screen ID text. Enter asterisks (**) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts, not the position in front of the text. Do not make any adjustments to account for attribute bytes. For example, if the screen ID text is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). The column position must be the screen column where the first character of the screen ID text is located.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens that must be processed, and no script processing will occur for this entry.
Field location
Follow the same guidelines as documented for the Screen ID Location field.
Replace exact matches only
Data replacement processing involves finding a system-generated field on an output screen, and finding where the text of that field is defined as input later in the script. This is a matching process. If an input field matches the system-generated field, it is replaced. If none of the input fields match the system-generated field, no data replacement occurs.
In some cases, the input field may not match the system-generated field. Leading zeros may not match or the input field may contain extra field-filler characters. Enter N in the Replace Exact Matches Only field to tell the script processor to handle these conditions and still make the match. If you enter Y, the system-generated field and the input field must match exactly or the input field is not replaced.
Date recalculation
If date recalculation processing results in the following message:
then the following items can help determine why nothing happened.
Screen ID text
This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. If the text does not match exactly, the script processor will not recognize the screens that require processing. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
Screen ID location
Screen row and column location of the screen ID text. Enter asterisks (**) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts, not the position in front of the text. Do not make any adjustments to account for attribute bytes. For example, if the screen ID text is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). The column position must be the screen column where the first character of the screen ID text is located.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens that must be processed, and no script processing will occur for this entry.
Is the Field a Date?
As the date recalculation component processes a script, it analyzes input fields to determine if the field is a date. If the input field is not a valid date, then it does not recalculate. The script processor uses the date separator character field and input date format field from the date recalculation entry to help make this determination. It also analyzes the day, month, and year portions of the date field to see if they make up a valid date. The parameters LOW_YEAR and HIGH_YEAR are used when determining the validity of a two-digit year field. These parameters are documented in the Performance Test Advanced-Configuration-Guide.
List processing
If a list processing run results in the following message:
then the following items can help determine why nothing happened.
Screen ID text
This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. If the text does not match exactly, the script processor will not recognize the screens that require processing. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
Screen ID location
Screen row and column location of the screen ID text. Enter asterisks (**) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts, not the position in front of the text. Do not make any adjustments to account for attribute bytes. For example, if the screen ID text is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). The column position must be the screen column where the first character of the screen ID text is located.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens that must be processed, and no script processing will occur for this entry.
Was a Selection Made from the List?
When the list processing logic finds the list screen, it checks to see whether an item was selected from the list. For example, it is possible that when the script was being recorded the user brought up the list screen, scrolled forward a couple of times, but then simply exited from the screen. Since the user did not select a row from the list, no list processing REXX is inserted for this scenario. The list processing function determines whether an item was selected by first analyzing the <KEY>. If the key does not match the selection PF key field, or either of the scroll PF key fields from the list processing entry, then it is assumed that a selection was not made. If the key matches the selection key, list processing analyzes the entered input.
- If the list type is cursor select, the cursor location is checked using <CURSOR> statement information, by comparing the row position where the cursor was with the list location top and bottom row fields in the list processing entry. If the cursor was on a row within the list, the list processing function assumes a valid selection was made and the REXX is inserted. If the cursor position was not within the list, list processing assumes that an item was not selected.
- If the list type is line command select, the list processing function checks whether a list item was selected by looking for data entered in an input field located within the list. For example, if the list processing function finds <I06>"s", and the location of input field number 6 is within the top and bottom rows of the list, it assumes that a valid list selection was made and the REXX is inserted. If nothing was entered in any of the input fields, or if the input fields that had data in them were not located in the list, the list processing function assumes that a selection was not made.
Synchronization
Normally, if something was entered incorrectly in a data replacement, date recalculation, or list processing entry, the REXX code is not inserted and nothing happens. For synchronization processing, the REXX is always inserted — even if the entry is incorrect. However, if the entry contained an error, the REXX code may not work correctly when it starts during playback. This makes it more difficult to recognize that an error occurred. Here are some items to check if it appears that the synchronization REXX routine is not working properly.
Screen ID text
This field is case sensitive — the uppercase and lowercase characters must match the screen ID in the script exactly. If the text does not match exactly, the script processor will not recognize the screens that require synchronization processing. Wildcards are not allowed. The wildcard character is treated as the actual screen ID.
Screen ID location
Screen row and column location of the screen ID text. Enter asterisks (**) as wildcards in the row and column fields to indicate that the screen ID text can be found anywhere on the screen.
If a row and column are entered into the screen ID location fields, the row and column must be the screen row and column position where the text starts, not the position in front of the text. Do not make any adjustments to account for attribute bytes. For example, if the screen ID text is located in the upper left corner of the screen, the position of that text may not be row 1, column 1. There may be an attribute character in position (1,1) with the text beginning at (1,2). The column position must be the screen column where the first character of the screen ID text is located.
If the screen ID is an * (asterisk), the ID location must be **,***. If the screen ID location is incorrect, the script processor will not recognize the screens that must be processed, and no script processing will occur for this entry.
Message text
The same rules apply to the Message Text field as documented above for the Screen ID Text field. If the message text is incorrect, the REXX logic will not detect that the message appeared during the playback, and the synchronization logic is never started.
Message location
The same rules apply to the message location field as documented above for the Screen ID Location field. If the message location is incorrect, the REXX logic never detects that the message appeared during the playback, and the synchronization logic is never started.