home   about us   contact us  
Distribtution
Financial
Appx
News
Search site for:




Unattended File Reorganizations

The APPX environment variables APPX_SCRIPT_IN and APPX_SCRIPT_OUT can be used to create a script that will reorganize a file or files without operator intervention. First, set APPX_SCRIPT_OUT=<SomeFileName>. Make sure APPX has permissions to write this file. Then reorganize the files (via export & import) as usual. The file <SomeFileName> will contain all your keystrokes, in a human readable form. You may edit this file if you wish, but note that the file must be line feed delimited only (not CR/LF as a normal DOS file). The next time you want to reorganize the same file(s), just set APPX_SCRIPT_IN to point at , and APPX will read the keystrokes from that file instead of the keyboard. When the file of keystrokes is exhausted, APPX will simply wait for keyboard input as usual.

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.



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
T- TRAP

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.

Do you have a tip you want to pass on? Contact Us.


« Return



© Copyright 2009 - C.A.N.S.Y.S. West Limited All Rights Reserved