As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.
In an unrelated text file, I have a value of a field on every record that I want to use when doing a TABLE FILE against a SQL table. I was thinking I could do a -READ to get that one field/value and have it end up in the output of the TABLE FILE (along with other data from that SQL table).
But I’m not having much luck with the -READ. I never got to the TABLE FILE, but when I do a -TYPE (to verify I have the correct value) after the -READ, I either get an error like:
or, I get the very first field in that unrelated text file instead of the field I’m interested in.
I’ve searched focal point, along with some PDF docs on the tech support website, but I haven’t figured this out yet. I've used a couple different formats of that initial, unrelated file, but that hasn't helped.
Any suggestions would be appreciated.
Thanks,
MarkThis message has been edited. Last edited by: folkie,
WF 8.2.02 App Studio DataMigrator ReportCaster Windows Server 2016
The original file (which has the field I want to use) was created via an Excel macro which output some fields from the spreadsheet into a text file. When I couldn't get the -READ to work with that text file, I used WF on that text file to create a focus table. When the focus table didn't work with the -READ, I created an FTM file via WF (I don't quite remember, but I think that was ON TABLE HOLD FORMAT ALPHA). But I couldn't figure out -READ with the FTM file either.
I haven't tried Tony's suggestion/link yet, but I noticed there (& previously), there's a -READ and -READFILE. What's the difference between those two? I've tried both, but I've mostly been trying -READ.
Thanks, Mark
WF 8.2.02 App Studio DataMigrator ReportCaster Windows Server 2016
No matter which one you use if the HOLD file is not created as part of the fex where you do the -READ or -READFILE you need to filedef the master file for the hold file. Your ON TABLE HOLD FORMAT ALPHA is the best way to create the file. With that syntax the name of the HOLD file will simply be hold.ftm with a corresponding hold.mas. If you want to name the HOLD file use ON TABLE HOLD AS SRV_HOLD FORMAT ALPHA using whatever name you want after the AS. If you are creating the HOLD file outside the fex where you are doing the -READ you should also add APP HOLD appfoldername so it saves the files in what ever appfolder you use. It is really best to create the hold file in the same fex as the -READFILE so you don't have to worry about the APP HOLD or FILDEDF's
With -READ you have to list each field and field length that is in the file with -READFILE you don't have to, it will create &variables based on the field names in the master file.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005
I guess I just needed to re-read these posts and links and the -READ syntax several times before it sunk in. I didn’t realize I had to list every master file field on the -READ statement. I was just listing the couple fields I was interested in. But after putting all the fields from the master file on the -READ statement, I was able to TYPE the fields I was interested in.
I also tried the -READFILE. With that, I apparently didn’t need to list all the fields (or any fields). But when I ran it, I got the auto-prompt for every field that I wanted to TYPE. Maybe if I first used the -DEFAULT (mentioned in the info about -READ but I didn't really understand it) it may have prevented the auto-prompt, but I didn’t bother trying that.
I haven’t tried the ultimate test yet (using a couple fields from that text file in a TABLE FILE) but I’ll assume I can do that now that I’ve got the -READ working with the -TYPE.
Thanks for all your suggestions, Mark
WF 8.2.02 App Studio DataMigrator ReportCaster Windows Server 2016