Focal Point
Existence of a field in a master file
March 03, 2008, 10:10 AM
Majid JeddiExistence of a field in a master file
Hi,
Is there a way to test the existence of a field in the master file prior to do any calculation on it?
Thanks for any suggestion
WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 03, 2008, 10:19 AM
GinnyJakesMajid,
Are you talking about whether the field has any data or whether the column exists in the master file description? Please clariy.
For the latter, you can do a CHECK FILE filename HOLD, then TABLE the hold file and do a WHERE FIELDNAME eq 'yourfield' and check &LINES.
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
March 03, 2008, 10:28 AM
Francis Mariani
CHECK FILE CAR HOLD
TABLE FILE HOLD
PRINT *
WHERE FIELDNAME EQ 'MODEL'
ON TABLE HOLD
END
-RUN
-SET &MSG =
- IF &LINES EQ 1 THEN 'FILE CAR CONTAINS A COLUMN CALLED MODEL'
- ELSE 'CAR DOES NOT CONTAIN A COLUMN CALLED MODEL';
-TYPE &MSG
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 04, 2008, 10:53 AM
Majid JeddiHi Francis and Ginny,
Thanks to both of your answers are the same.
But there is no other way without tabling.
Thanks again
WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 04, 2008, 11:19 AM
RSquaredCan you look in the filename.mas ? This will at least tell you if the field is in the file/table/whatever.
WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
March 05, 2008, 09:45 AM
PBrightwellAre you meaning to test if the field is null? or in the MFD?
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 06, 2008, 09:20 AM
Majid JeddiHi PBrightwell
I wanted to test the existence of field in a master file.
Regards
WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 06, 2008, 09:50 AM
PBrightwellTry IF MISSING.
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
March 06, 2008, 10:12 AM
Tony AMajid,
The answer has already been given, but to assist you in understanding it -
You are in a room.
There is a bucket filled with water in the middle of that room.
You want to know if it has any fish in it.
How are you going to find out?
You have to look in it!!
To find the field visually, open the MFD in a viewer.
Programatically, then use the solution suggested by Ginny and then given away by Francis.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
March 06, 2008, 11:21 AM
Majid JeddiTony,
I understood it from the post of Francis and I implemented it.
I do not nderstand what you are trying to say.
Regards
WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
March 06, 2008, 03:47 PM
Francis MarianiT,
You could keep your eyes closed and swallow - if something slippery went down your gullet, then, most likely it was a fish.
F.
March 07, 2008, 09:52 AM
PBrightwellMajid,
I think you are asking the question wrong. If you want to know if the field is in the Master File, open the Master file and look. If you want to know if there is data in that field, try
COMPUTE ANYAMT/D10=IF DATAFIELD IS MISSING THEN O ELSE DATAFIELD *10;
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes