Focal Point
[SOLVED] testing for the existence of a field.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/495103261

June 25, 2009, 09:30 AM
Mark1
[SOLVED] testing for the existence of a field.
Hey,
I'm trying to make a GOTO statement that says:
If field X exists in the held file then goto here, else goto there. Is there an easy way to do this?

This message has been edited. Last edited by: Mark1,


Windows version 768
June 25, 2009, 09:53 AM
GinnyJakes
How many rows are there in the hold file? You could write a flag to a SAVE file, -READ it into an amper variable and then use DM looping or GOTO to accomplish your needs.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
June 25, 2009, 06:21 PM
Waz
If you are trying to determine if a particular column exists in a hold file, then use:
TABLE FILE SYSCOLUM
PRINT NAME
WHERE TBNAME EQ 'Hold File Name'
WHERE NAME EQ 'Column Name'
ON TABLE SAVE
END
-RUN
-IF &LINES GT 0 THEN GOTO ...



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 25, 2009, 06:35 PM
Doug
Do you mean: "If field X has a value?" If so, then Ginney plan should do the trick. However, if you mean "Does field X exist in a file?" then Waz's plan should work. But, you should already know if the "field" exists as it's part of your TABLE FILE request. Otherwise, I'm confused... Confused
June 29, 2009, 10:24 AM
Mark1
Thank you! Waz's code is what I needed... thanks again!


Windows version 768