Focal Point
[SOLVED] Access text data on server

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

October 25, 2011, 07:44 PM
JM @ CTL
[SOLVED] Access text data on server
Need help with accessing a 250 byte record text file on a server. The server is NOT in the "ibi" path. I have tried several FILEDEF scenarios but am not able to retrieve any data. The server I'm wanting to access is a Windows server.

Pointing me to the documentation that might contain this information would be just as helpful as copying code in a reply, but the code sample route is fine, too.

Thanks,
Joe Mack, CenturyLink

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


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
October 25, 2011, 08:04 PM
Waz
What FILEDEF's have you tried.

Should look like this (Windows)

FILEDEF MY_FILE DISK C:\MYDATA\MYFILE.TXT

or

FILEDEF MY_FILE DISK \\MYSERVER\MYSHARE\MYDATA\MYFILE.TXT


There are also options for the FILEDEF.
LRECL = Logical Record Length
RECFM = Record Format (F = Fixed, V = Variable)

e.g.
FILEDEF MY_FILE DISK C:\MYDATA\MYFILE.TXT (LRECL 250 RECFM F


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!

October 25, 2011, 08:08 PM
njsden
quote:
The server is NOT in the "ibi" path


For the WebFOCUS server to access a file (text or any other supported format) the latter has to be accessible via the operating system. If the file is not in the same "box" where the WF server is running then you need to share that location so both the OS and WebFOCUS can access it. Mapping a drive (E:, F:, etc.) to the exact location would be helpful. From there, all you need to do is MAP that location in WebFOCUS and get to the file.

For instance, this scenario:

datasrv -> Repository of data files located in D:\shared_resources and shared as windows SMB resource (let's say "shared"). Within it you have a folder called "data" with a set of data files you need access to (e.g. mydata.txt)

wfsrv -> Box where the WebFOCUS reporting runs. From this box, via Windows, you should be able to access \\datasrv\shared\data\myfile.txt or for simplicity, you could map \\dataserv\shared as F: and then the file could be accessed as F:\data\myfile.txt. This is just OS stuff, not still related to WF.

Accessing the file from WebFOCUS should be very easy as the OS can now see it.

APP MAP DATA F:\data
FILEDEF MYFILE DISK DATA/myfile.txt 
-RUN


Al you need now is to create a masterfile for MYFILE (myfile.mas) describing your text file and then issue a regular TABLE FILE MYFILE to use it.

Take a look at "Describing Data with WebFOCUS Language" for details on how to create the master file, and "Creating Reporting Applications" for details about APP MAP, FILEDEF and other user APP statements.

Sorry, I'm not able to access IBI's tech support right now so cannot provide actual document names and/or DN#.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
October 26, 2011, 05:33 PM
JM @ CTL
thanks to both who replied. I tried each of your ideas without success. Then...(of course) it dawned on me...the files I was trying to read had ticks as first and last character of the PC/server filename. This is ABSOLUTELY illegal on the main frame, but totally acceptable on the PC. So, once I renamed and removed the ticks (didn't want them in the name, really) it worked with just about all methods you provided. old dog, new tricks!


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)