VISIMAGE users have requested the ability to write temporary LINKS that have no long-term purpose and are not worth the effort to add to the 'visimmgr' file. Many times this need occurs when a SUPRTOOL or flat file contains
'pre-processed' data and all you need to do is link it into the live database. Another valid scenario might involve a new KSAM file which contains data you want to merge into an existing report. Since AskPlus permits a LINK to
be defined during a SELECTION process, all you have to do is give VISIMAGE the correct syntax to build a 'link on the fly'.
Presume you have a field called CUST-NO in your topic CUSTOMERS. There is additional summary information about the customer in a KSAM self-describing file called CUSTOTS. The key to the KSAM file is called CUST-KEY. Your goal is
to find customers in California and Texas with total sales from CUSTOTS less than $1000. Follow the 3 steps below after opening your 'Define a Selection' window:
1. Go to the
Selection VARIABLES Window:
|
Name
|
Type
|
Len
|
Dim
|
Initial Value
|
|
CUSTLINK
|
Num
|
1
|
|
0); link CUSTLINK, customers.cust-no
:: custots.cust-key;*
|
2. Now open the Selection OPTIONS Window:
To use a link-on-the fly, you MUST go into Selection OPTIONS and set the Output select file definition to @. This will permit you to include the newly linked datasets in your
'select' file.
3. On the Selection CRITERIA window, use this syntax:
Customers.State = "CA","TX" and CUSTLINK..custots.TOT-SALES < 1000
If you want to open the linked file, but not limit it by a specific value, enter:
Customers.State = "CA","TX" and CUSTLINK..custots
The main disadvantage to 'links on the fly' is that item names from the linked file do not appear in the Item List.
You will have to either type those item names in the screens where you need them or temporarily change topics to the target set so you can build another item list and select the items from that list. Just remember to go back to your original topic(s) before pressing GO.
Note: There are situations where 'links on the fly' are better defined as REPORT variables than as SELECTION variables. Call Vital Soft if you want help in determining which is best for your
particular problem.