One way to make a report writer easier for end users is to provide a list of predefined 'macros'. Usually the macros will include complex date conversions and perhaps some calculations and concatenations that are specific to your data.
Macros require that you maintain an HP text file where you assign a NAME and DEFINITION for each macro you want the user to access. When the definitions are complete, you will use that text file in AskPlus to create a KSAM file which will be added to the user's Visimage environment. In the discussion that follows, the text file is called MACRODEF (for Macro Definition file). The "compiled" file is called MACRO.
Step by Step:
1. Logon to the HP in the group where you will be maintaining the other user files for Visimage.
2. Run your favorite text editor. Build a file that contains your specific macro names and definitions. You can add as many or few as you like and append to the list when necessary. (See MACRO Samples for sample definition files. If you do not find one, perhaps you can choose one that is close and modify it.)
3. In the MACRO Samples we provide, you will see that some 'file housekeeping' is performed at the beginning of the definition file. This is necessary to assure the new file of macros builds correctly.
4. The syntax of a macro statement as it appears in a text file is as follows:
MACRO MACRO-NAME(perhaps a parameter) = DEFINITION
You supply a suitable MACRO-NAME (not a database item name) and then some expression that DEFINES your macro. An " & " at the end of the line continues the macro definition. A final line with << >> around it will show as a COMMENT or explanation up to 16 characters.
5. When the new macro definitions has been added, save the file unnumbered. Exit the text editor.
6. FINAL STEP: To 'compile' this editor file into a KSAM file called 'MACRO', simply:
RUN ASKPLUS.PUBNAT.ASKPLUS;XL="XL.PUBNAT.ASKPLUS"
X MACRODEF
EXIT
7. If this is the very FIRST time you have created a macro file, a line will have to be added to the appropriate 'VISIMMGR' file. For example:
MACROFILE: MACRO. group;
8. When the macro definition file is updated and ready to be implemented, the commands in step #6 must be repeated. Users should NOT be running Visimage at such times.