Focal Point
Redefine a field in focus load (mainframe)

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

February 11, 2008, 06:37 PM
Thao
Redefine a field in focus load (mainframe)
Hi,
I currently have a field A defines in Focus Load (mainframe) as A5. I have a request from a user that wants to add a field B that redefines field A as A7. How do I do?
Please advise. Thank you so much!


Thao-
February 11, 2008, 11:35 PM
Leah
I don't know about FOCUS loads, but redefining a smaller field with a larger is not something most programming languages accept. Or is the field the load is going into larger now?


Leah
February 12, 2008, 06:44 AM
M Cavanaugh
Thao,
There is no need for a new physical field in your database.

You have two (2) options using DEFINE.

1. Have the customer code the following into their FOCUS code:
DEFINE FILE xxx
NEWFIELD/A7 = OLDFIELD;
END

2. Add a new DEFINE (virtual) field to the existing FOCUS MASTER. This can be done with any MASTER and does not have to be a FOCUS database - please check your FOCUS doc for the coding details in your environment.
Here is a simple example from the mainframe environment:
DEFINE NEWFIELD/A7 = OLDFIELD;

Have fun!
Michelle


WebFOCUS Production: UNIX 7.7.03M
WebFOCUS Test: UNIX EDASERVE 7.7.05 Client 8.0.01
February 12, 2008, 08:55 AM
PBrightwell
The question I have is much the same as Leah's, Why would anyone want to do that? You will still be getting the same 5 characters. If the size of the field is actually changing and it is a Focus database you need to unload the data into a flat file, change the master and reload.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
February 12, 2008, 11:39 AM
cburtt
Thao,

Regarding M Cavanaugh's option #2, adding a DEFINE statement (at the bottom) of a *.mas to create a virtual column in the table and thereby offer a reformatted version a 'real' column specified earlier:

The name you give the DEFINEd column can be important. If you name it differently than the column upon which it is based, then both fields will appear in the various developer tools that list fields in a master. If you give it the same name as the base field, then only the DEFINEd field will show in a tool's list of fields. This enables you, if you wish, to completely hide all knowledge of the base field and restrict reports to accessing the data only in the revised format as specified by the DEFINE.

Sometimes this is quite useful.

Chris Burtt


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
February 12, 2008, 03:50 PM
Thao
Thank you...thank you all. M Cavanaugh's option #2 is worked perfectly.
February 12, 2008, 03:52 PM
Thao
Thanks Michelle. I applied option #2 to my focus load and it worked as expected. You're so good. Thanks again. You made my day!
Thao-

quote:
Originally posted by M Cavanaugh:
Thao,
There is no need for a new physical field in your database.

You have two (2) options using DEFINE.

1. Have the customer code the following into their FOCUS code:
DEFINE FILE xxx
NEWFIELD/A7 = OLDFIELD;
END

2. Add a new DEFINE (virtual) field to the existing FOCUS MASTER. This can be done with any MASTER and does not have to be a FOCUS database - please check your FOCUS doc for the coding details in your environment.
Here is a simple example from the mainframe environment:
DEFINE NEWFIELD/A7 = OLDFIELD;

Have fun!
Michelle