Unattended File Reorganizations
The APPX environment variables APPX_SCRIPT_IN and APPX_SCRIPT_OUT can be used to create a script that will reorganise a file or files without operator intervention. First, set APPX_SCRIPT_OUT=
A script file can be created that invokes APPX with the APPX_SCRIPT_IN environment variable set, and then this can be invoked automatically under 'cron' for Unix system, or 'AT' under NT.
Also note that you can use Unix or NT environment variables in the APPX_SCRIPT_IN file. For example, where the file might normally have a database id of 'RAD' explicitly specified, you can use $db (#$db for NT), and then 'export db=RAD' (or 'set db=RAD' for NT) before invoking APPX. APPX will substitute RAD wherever it sees '$db' in the APPX_SCRIPT_IN file.
This technique can be used to run any APPX process unattended.
DISCLAIMER: Note that you are typing 'blind', i.e., you have no idea if your commands are being executed as you expected. If an unexpected prompt appears, APPX will still continue to read the keystrokes from the input file, and deal with them as if the user was typing them in, which may lead to unexpected results.
Unattended Process Execution
Under Linux/Unix, it's easy to create a cron entry that will run an Appx process at a scheduled time (see this tip in the FAQ. Under Windows, the process is similar:
- Create a Windows .bat file which specifies the process to be run e.g. C:\Appx42a\appx.exe -application=CRT -database=CWU -type=Input -process=END_USERS -session
- Use the Windows 'at' command to determine when this batch file should be run. See MS Technet for more info. Alternatively, you can use the Windows Scheduler to execute the batch file as required - http://support.microsoft.com/kb/324283/en-us.
Using the -session flag means that Appx will respond with an END to any request for keyboard input instead of waiting for a non existant user to enter something.
Undocumented ILF Editor Tips
The undocumented Option 95 feature is an easy way to navigate between GOSUB's and their corresponding LABEL commands, like Option 94, but in reverse. If you position the cursor at a LABEL statement, then press Option 95, APPX will take you to the first GOSUB/GOTO statement that references that label. Pressing Option 95 again takes you to the next GOSUB/GOTO that references the same label. If you position the cursor on a GOSUB/GOTO and press Option 95, APPX will take you to the next GOSUB/GOTO. This makes it easy to see where subroutines are called from.
The XCOPY feature is a powerful way to copy code from one event point or process to another, however when copying from an image level event point, there are a lot of key fields to remember (process type, name, frame type, frame sequence no, image number), which makes it difficult to use. There is a SCAN capability, but if you've ever tried it, you know the scan display always comes up empty, as if there weren't any frames in the source process. The way to get the SCAN display to show something meaningful is to select a starting key and then press Enter. For example, while in the ILF editor, press Option 6 as if you were going to do an XCOPY. Choose the Pre-Display event point. For the process type and name, pick something that you know has lots of frames of different types. Then press SCAN on the Frame Class field. The SCAN display will come up empty. Now choose the RECORD frame class in the starting key, and press Return. All the Frames in your process will now be listed, and you can pick the frame you need.
If you know you want to copy from a RANGE-END, or any other frame class, you can choose that as your starting key, and APPX will display all the frames of that type.
We have also discovered some shortcuts that can be used when entering the ILF verbs:
BA - BEG AT
EA - END AT
BR - BEG READ
BL - BEG LOOP
EL - END LOOP
R - READ
W - WRITE
REW - REWRITE
S - SET
A - APPEND
G - GOSUB
I - IF
Also, you can spell RECIEVE incorrectly, and the editor will correct it.
These tips were discovered in 4.1.8, but may exist in earlier versions.
Undelete in ILF Editor
Now that cut/copy/paste has been introduced in the ILF editor, a pleasant side effect is that we now have an "undelete" capability. When you delete lines via F10, the editor actually places them in the "cut" buffer, as if you had chosen "cut" instead of "delete". This means you can undelete those lines by simply choosing "paste". Note that only the last lines you cut or deleted can be pasted, this is not an "undo" buffer.
Using Outputs to generate unique file names.
If you need a unique file name for a temporary file, you can use an OUTPUT process to generate one for you. Just define an OUTPUT with no PCF, and no other frames. When you run the OUTPUT, APPX will first find a unique name for the report, even if it's not going to actually print anything. You can refer to --- PRINT FILE PATHNAME to get the name. Note that APPX does not actually create the file for you, you only get the name.
For additional information, contact firstname.lastname@example.org
[back to top]