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     [SOLVED] Upload multiple csv files using FILEDEF (APPEND

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Upload multiple csv files using FILEDEF (APPEND
 Login/Join
 
Gold member
posted
Hi,
I have two CSV files and i need to use those csv files as data source.(both are in same format)
so i have created master file for csv and uploaded the first csv file using FILEDEF to HOLD file and created the report.
Now i want to append the second csv file to first data source.
I used the FILEDEF (APPEND in to merge the second data source but in result iam getting only second data source values(second csv file data). below are my code. pls tell me what is missing in below code.
Pls guide me how to upload multiple csv files using FILEDEF (APPEND

FILEDEF WMS_ BASEFILES DISK C:\IBI\APPS\BASEAPP\WMS_BASE1.CSV
-RUN
TABLE FILE WMS_BASEFILES
PRINT
*
ON TABLE HOLD AS WMS_FILES FORMAT ALPHA
END
-RUN
FILEDEF WMS_ BASEFILES DISK C:\IBI\APPS\BASEAPP\WMS_BASE2.CSV (APPEND
-RUN
TABLE FILE BASEFILES
PRINT
*
ON TABLE HOLD AS WMS_FILES FORMAT ALPHA
END
-RUN

TABLE FILE WMS_FILES
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END

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


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Virtuoso
posted Hide Post
You cannot have twice
TABLE FILE WMS_BASEFILES
PRINT
*
ON TABLE HOLD AS WMS_FILES FORMAT ALPHA
END
-RUN

Each defines a brand new WMS_FILES, it's the reason why you only have the second one as result

What I suggest is to HOLD both csv in separate files then merge them.
FILEDEF WMS_BASEFILES DISK C:\IBI\APPS\BASEAPP\WMS_BASE1.CSV
-RUN
TABLE FILE WMS_BASEFILES
PRINT
*
ON TABLE HOLD AS WMS_FILES1 FORMAT ALPHA
END
-RUN
FILEDEF WMS_BASEFILES DISK C:\IBI\APPS\BASEAPP\WMS_BASE2.CSV
-RUN
TABLE FILE WMS_BASEFILES
PRINT
*
ON TABLE HOLD AS WMS_FILES2 FORMAT ALPHA
END
-RUN

TABLE FILE WMS_FILES1
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
MORE
FILE WMS_FILES2
END


Also you need to have the proper FILEDEF names :-) without spaces between WMS_ and BASEFILES...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
Thanks Martin.
spaces in FILEDEF name is copy/paste error..Smiler

Then how to use (APPEND in FILEDEF...?


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Virtuoso
posted Hide Post
My pleasure.

Edit your first post and add [SOLVED] at the beginning of the subject.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
If your goal is to combine the data from WMS_BASE1 and WMS_BASE2 you should consider using the MORE command in your TABLE request.

Make sure you have a master file defined for each csv file. The two files should have the same data structure (which you confirmed is true).

TABLE WMS_BASE1
PRINT *
MORE
FILE WMS_BASE2
ON TABLE PCHOLD FORMAT EXL2K
END

This will read the two files and return the combined output.

What you're currently doing is mapping WMS_BASEFILES to two different datasets and over-writing WMS_FILES with the last one's results.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
APPEND is used when writing to a file, like on your HOLD statements, not reading them.


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
Gold member
posted Hide Post
Thanks for all your replies.

Waz

can you give me a example for filedef with append..?


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Guru
posted Hide Post
lot of examples in this forum..

here's the one

SET HOLDLIST = PRINTONLY
FILEDEF F1 DISK F1.ftm (APPEND
-RUN
TABLE FILE CAR
PRINT
COMPUTE XCOUNTRY/A10='Dummy file';
COUNTRY NOPRINT
WHERE COUNTRY EQ 'ENGLAND'
ON TABLE HOLD AS F1
END
TABLE FILE CAR
PRINT COMPUTE XCOUNTRY/A10=COUNTRY;
ON TABLE HOLD AS F1
END

TABLE FILE F1
PRINT
XCOUNTRY
END


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Expert
posted Hide Post
As a rule of thumb, I always add a FILEDEF without (APPEND before using the file.

Used to cause errors in older versions.


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
Guru
posted Hide Post
Thank you Waz, I will keep in mind
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Gold member
posted Hide Post
Thanks Waz & Rifaz


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Virtuoso
posted Hide Post
-DOS COPY FILE_1.CSV + FILE_2.CSV COMBINED.CSV

TABLE FILE COMBINED
.
.
.
.


I just coded a unit that combines about 400 flat files, scattered across 20 different subfolders on a different machine, selected from thousands of others based on the user's choice of month and year markers. They all append into a single 100MB data file via DOS commands and a couple of prep TABLE FILES in order to get all the file names set up for inclusion. Quite crazy, but it works. I'm offering to present it at Summit this summer.

Flat files are amazingly simple to manipulate outside of FOCUS via OS commands. With a couple of DIR and COPY commands, and a little bit of TABLE FILE to paste things together you can cover a lot of ground very quickly.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
Most production systems turn off OS commands so users can't hack at their applications.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
I'm doing this on the iWay server so it's limited to a very small number of potential users. But point taken.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report 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     [SOLVED] Upload multiple csv files using FILEDEF (APPEND

Copyright © 1996-2020 Information Builders