Focal Point Banner


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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Closed] External File to Table

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Closed] External File to Table
 Login/Join
 
Gold member
posted
I have an external file saved on a shared drive with 3 columns. I have tried to save this file as a csv file and an excel file in order to pull the data contained in the file into a Webfocus Report as an external table.

I am able to pull in the data and run a report, but when i do its taking my 3 columns and placing all the data into 1 column.

My Master File:
FILENAME=fits_project, SUFFIX=FIX, $
SEGMENT=fits_project, SEGTYPE=S1, $
FIELDNAME=CASE_NUMBER, ALIAS=CASE_NUMBER, USAGE=A10V, ACTUAL=A10,
MISSING=ON, $
FIELDNAME=ITEM_NUMBER, ALIAS=ITEM_NUMBER, USAGE=A3V, ACTUAL=A3,
MISSING=ON, $
FIELDNAME=ITEM_TYPE, ALIAS=ITEM_TYPE, USAGE=A4V, ACTUAL=A4,
MISSING=ON, $

My Fex Code:
ENGINE SQLORA SET ORACHAR VAR
ENGINE SQLORA SET VARCHAR OFF
SET ASNAMES = ON
APP FI fits_project_hold DISK baseapp/fits_project_hold.ftm
APP HOLDMETA baseapp
APP MAP DATA \\ftmvfxs1\cfisfm$\Dashboard
APP APPENDPATH DATA
APP HOLD DATA
APP SHOWPATH
-RUN
APP FI fits_project DISK DATA/fits_project.XLSX
-RUN
TABLE FILE FITS_PROJECT_HOLD
PRINT
CASE_NUMBER
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
END

Orginal file that is saved on my shared drive:
2020973741 1 PRSI
1820943742 2 RESI
1920933745 4 EMPL
1020953748 5 REFE
1520963744 6 REFE

How Report Data is being returned:
CASE_NUMBER
2020973741
,001,PRSI
1820943742
,002,RESI
1920933745
,004,EMPL
1020953748
,005,REFE
1520963744
,006,REFE

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 2010Report This Post
Expert
posted Hide Post
I am a bit confused with the files and output.

Your original file has no commas, but the returned file does.

The master file you are using is for a fixed format file with a record length of 17.

Is fits_project_hold.ftm the orignal file ?

When posting code and data, please use the code tags.


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Sometimes (often?) folks post a lot of non-relevant code with their issue. So it's hard to see the wood for the trees. To cut to the chase, here is what is relevant.

quote:
My Master File:
FILENAME=fits_project, SUFFIX=FIX, $
SEGMENT=fits_project, SEGTYPE=S1, $
FIELDNAME=CASE_NUMBER, ALIAS=CASE_NUMBER, USAGE=A10V, ACTUAL=A10,
MISSING=ON, $
FIELDNAME=ITEM_NUMBER, ALIAS=ITEM_NUMBER, USAGE=A3V, ACTUAL=A3,
MISSING=ON, $
FIELDNAME=ITEM_TYPE, ALIAS=ITEM_TYPE, USAGE=A4V, ACTUAL=A4,
MISSING=ON, $

My Fex Code:
APP FI fits_project DISK DATA/fits_project.XLSX
-RUN
TABLE FILE FITS_PROJECT_HOLD
PRINT
CASE_NUMBER
ON TABLE PCHOLD FORMAT HTML
END

Orginal file that is saved on my shared drive:
2020973741 1 PRSI
1820943742 2 RESI
1920933745 4 EMPL
1020953748 5 REFE
1520963744 6 REFE

How Report Data is being returned:
CASE_NUMBER
2020973741
,001,PRSI
1820943742
,002,RESI
1920933745
,004,EMPL
1020953748
,005,REFE
1520963744
,006,REFE


First of all, I'd suggest sticking to convention and use upper case for your FILEDEF (APP FI) if you are going to use it in the TABLE request.

Secondly, your FILEDEF references an XLSX file, which is not fixed format and your master is for fixed format.

Third, you need to indicate the length of the entire line of your fixed-length data

You need to make your data file a .TXT or .DAT file and your FILEDEF like this:

FILEDEF FITS_PROJECT DISK DATA/fits_project.txt (RECFM F LRECL 16

Fourth, your TABLE request references FITS_PROJECT_HOLD when the FILEDEF is only for FITS_PROJECT (no _HOLD portion)


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Gold member
posted Hide Post
Yes the orginal file does not have commas, so i am not sure why the new file contains commas.

The original file is pulling off a shared drive and i have tried saving it as a .xlsx format and a .csv file.

All code generated by WebFocus was uploaded to focal point for this example.


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 2010Report This Post
Master
posted Hide Post
The new file has commas because you have FILEDEFed it as an Excel or csv. You data file is FIXED FORMAT. Look up FIXED FORMAT in the Describing Data manual.

You need to use the FILDEF (or APP FI) that I gave you and then fix the other items.

Actually, now that I look it I see that your master file is of type S1. That means the CASE_NUMBER is the key field, so MISSING=ON is incorrect for that field in your master file description.

PS - Waz is right that the Record Length is 17 not 16 as I wrote above.

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
George,

You also missed some "wood" as the Excel file is not the one being tabled -

APP FI fits_project_hold DISK baseapp/fits_project_hold.ftm


"Wood" it not be great if folks just placed the relevant code here? Wink

T

This message has been edited. Last edited by: Tony A,



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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Actually I did notice that Tony, although I may have expressed it a bit clumsily.

quote:
Secondly, your FILEDEF references an XLSX file, which is not fixed format and your master is for fixed format.


Thanks

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Gold member
posted Hide Post
Focal Point: Please mark case as solved: This issue was solved internally. After identifying a piece of code was incorrect in the master file.

Thanks!

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 2010Report This Post
Expert
posted Hide Post
Hi Lynsi,

You need to mark the topic closed by editting your very first post and making a change to the subject line.

To edit your post you need to click on the icon in the lower right of the section containing your post that resembles a pencil eraser over a folder icon.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Closed] External File to Table

Copyright © 1996-2020 Information Builders