Focal Point
Editing a focus format file.
April 14, 2008, 07:53 AM
FirozEditing a focus format file.
Hi,
I have a task of altering some records of a focus format file. I thought of converting the file into lotus format and editing the lotus format file and then again reconverting the lotus format file into focus format. Is this the right way to doo it? If yes, Please let me know how can I convert a lotus format file into a focus format. If you have any other way of doing this task please let me know.
Thanks in advance.
Thanks
focus on mainframe client
Windows
Excel
April 14, 2008, 09:06 AM
codermonkeyAre you needing to alter the field formats of the FOCUS file or simply change data values in existing records?
If you are simply updating data values, you can do it via MODIFY code. You can look it up in the FOCUS manuals.
If you need to alter the table structure, that's a little more involved.
April 14, 2008, 09:31 AM
GinnyJakesWhile MODIFY or MAINTAIN is the best way, another way would be to TABLE the existing file and save it as an ON TABLE HOLD FORMAT ALPHA. If you have a formula for what records you want to change, you can do that in the TABLE request using DEFINE to alter the contents. If not, make sure that the HOLD file is in a permanent location then use an editor to make your changes.
Then, do the following:
APP FI yourholdfilewith changes DISK location/hold.ftm <== Change to match your hold name
-* Backup file first.
-* focusfilename is what you call your FOCUS file.
-* Below, replace HOLD with whatever AS name you gave your hold file.
CREATE FILE focusfilename
MODIFY FILE focusfilename
FIXFORM FROM HOLD
DATA ON HOLD
END
That should do it for you.
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
April 14, 2008, 11:50 AM
FirozThanks for all your support. After making changes I need to again keep my file in focus format itself. I have alread modified this in LOTUS format now i want it to reformat back to focus. How can I do that ?
Thanks,
Firoz
Thanks
focus on mainframe client
Windows
Excel
April 14, 2008, 12:45 PM
GinnyJakesYou will have to export the file from Lotus into a fixed format file, create a master file description for it, then do the code in my previous post which will reload the file.
Please be sure to back it up first.
You can look up MODIFY with FIXFORM input.
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
April 15, 2008, 07:25 AM
FirozHow do I export the file from Lotus into a fixed format file ?
Thanks
focus on mainframe client
Windows
Excel
April 15, 2008, 07:57 AM
Danny-SRLFiroz,
I gather that you have to alter the data manually and not by using a COMPUTE statement in MODIFY.
If so, forget about Lotus. Use Excel instead.
Do a TABLE FILE on your FOCUS file and extract the fields you need to alter together with the FOCUS file record keys and HOLD FORMAT EXL2K.
After you fiddle with your data, use ODBC to access the data and create a MASTER with the WebFocus console.
The TABLE FILE on the new master, hold it and load it into you FOCUS file using MODIFY.
MODIFY FILE focusfile
FIXFORM FROM holdfile
MATCH keyfields
ON MATCH UPDATE datafields
ON NOMATCH REJECT
DATA ON holdfile
END
Good luck!
Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
April 15, 2008, 09:04 AM
PBrightwellFiroz,
When you say Lotus do you mean Lotus 1-2-3 or Lotus Notes?
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 15, 2008, 09:23 AM
FrankDutchquote:
Originally posted by PBrightwell:
Firoz,
When you say Lotus do you mean Lotus 1-2-3 or Lotus Notes?
Please do not make it more complex then needed....
Every one understands that it will not be notes.
Firoz
As far as I do remember you can with Lotus do the same things as with Excel.
You can save an excel spreadsheet as CSV file and that is possible in Lotus too.
If you have fieldnames on the first row, you get them in the output file too.
Since you created the file first I hope you ket the Masterfile, otherwiseyou need to create that master also.
|
Frank |
| prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7 |
April 15, 2008, 11:52 AM
FirozThanks for all the assistance.
I think all of you are referring to the Web based focus. I work on mainframe and i need to do the same thing in mainframe. I understand that the same procedure as mentioned above can be incorporated in mainframe. please verify and post your helpful comments in this regard.
Thanks in advance.
Firoz
Thanks
focus on mainframe client
Windows
Excel
April 15, 2008, 12:35 PM
GinnyJakesPlease see my original post. It does not use Lotus and allows you to do everything on the mainframe.
It is really a simple technique and one that I use repeatedly on a number of platforms. You might have to do a DYNAM instead of a FILEDEF.
Do some reading and give it a shot.
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
April 15, 2008, 02:21 PM
PBrightwellFrank,
I am trying to simplify this not complicate it. If Firoz means 1-2-3 (spreadsheet) then he should be able to save it as a csv file create a master and read it back. If he means Notes, there is an ODBC connector that can read Notes with WebFocus.
Firoz,
I am with Ginny, I would not do this in Lotus. If the modifications are something you can do in a program you should. I would use TABLE logic to save a file with the keys of the records I want to alter, and any data that you might want to change and then use MODIFY to update those fields.
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
April 16, 2008, 06:59 AM
M CavanaughFiroz,
Before I add to this conversation...
Is this a one time process? If so any of these solutions will work.
If this is a process that will need to be done numerous times in the future on the mainframe - the solutions are kind of complex as you need to keep crossing OS's and there are other methods that I can elaborate on - if needed.
Michelle
WebFOCUS Production: UNIX 7.7.03M
WebFOCUS Test: UNIX EDASERVE 7.7.05 Client 8.0.01
April 16, 2008, 09:16 AM
GinnyJakesMy solution can be done entirely on the mainframe.
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
April 16, 2008, 01:59 PM
DLautzCinciIf you are using mainframe FOCUS, you should have access to the old FSCAN command that will let you edit the FOCUS database directly. This will work if you want to add, change, or delete records. If you need to do other types of record reformating, you will want to listen to the other postings.
Be sure to make a backup copy of the file and read the documentation first!
http://documentation.informationbuilders.com/masterinde...3/13direditfocus.htm
Personal: Windows 7.7.02
Clients: Variety
April 17, 2008, 07:59 AM
FirozHi,
First I converted the focus file into alpha using the following code.
TABLE FILE
focusfile PRINT *
ON TABLE SAVE AS
alphafile FORMAT ALPHA
END
Then manually edited the alpha file.
Then I converted the alpha file back to focus format using the following code.
DYNAM ALLOC FILE
alphafile DA
userid.alphafile.data SHR REUSE
DYNAM ALLOC FILE
focusfile DA
userid.focusfile.focus SHR REUSE
CREATE FILE
focusfile MODIFY FILE
focusfile FIXFORM FROM
alphafile DATA ON
alphafile END
Please let me know if my coding is correct. Also any additional concepts which i can include to improve the effeciency or prevent unusual errors in future.
Thanks,
Firoz
Thanks
focus on mainframe client
Windows
Excel
April 17, 2008, 02:33 PM
GinnyJakesFiroz,
That looks perfect except that you should say
ON TABLE HOLD AS alphafile FORMAT ALPHA
You need the hold master in order to do the MODIFY FIXFORM using the FROM option.
As for additional concepts, as I mentioned before, if you want to change the same thing in all the records, you can do a DEFINE before your first TABLE, such that with ASNAMES turned on your hold file will have all the changes in it and you can do the MODIFY without having to change the data by hand.
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
April 18, 2008, 06:31 AM
FirozGinny,
I have coded the above code in two different focexecs. And using SAVE worked for me instead of HOLD. Please let me know if I am still wrong. And also what impact would be there if I change it to HOLD ?
Firoz
Thanks
focus on mainframe client
Windows
Excel
April 18, 2008, 06:36 AM
FrankDutchWith a HOLD you also get a master file,
with SAVE you will not.
If you need the master file (or better if you need the output with a descriptive file) you better use HOLD.
|
Frank |
| prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7 |
April 18, 2008, 09:07 AM
GinnyJakesFiroz,
I don't understand why your MODIFY is working without a master. Without a master, you would have to say
FIXFORM FLD1/format FLD2/format
DATA ON alphafile
END
There should be no ramifications to using HOLD instead of SAVE in this case.
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
April 18, 2008, 09:59 AM
PBrightwellquote:
DYNAM ALLOC FILE focusfile DA userid.focusfile.focus SHR REUSE
CREATE FILE focusfile
Your extention on the FOCUS DB should be .FOC. Are you wanting to completely replace the existing file? CREATE will wipe out the existing file.
Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes