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.
We have 40 departments that export a csv file from their Kronos time keeper systems and upload them to a folder on our NAS for import in to Peoplesoft so people can get paid.
The files look like: elapsed_time-cmp_2012_06_09 elasped_time-fdp_2012_06_09 elasped_time-cor_2012_06_09
The 3 different alpha charactors is the department the csv came from.
We want to run a WF report against all of these files to check the integrety of the data before they are imported in to people soft.
Can I make an ODBC conenction to a //network/storagelocation/ that will use all the files (*.csv) present?This message has been edited. Last edited by: Greg,
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
Once you have defined the location of the files to WebFOCUS, I believe I remember seeing a technique in the "Techniques You Can Use on Monday" Summit presentation for concatenating groups of flat files with the same naming convention through use of the wild card character (*):
FILEDEF KTK_DATA DISK <app folder name>/elapsed_time-*_2012_06_09.csv
or
FILEDEF KTK_DATA DISK <app folder name>/elapsed_time-*.csv
or
FILEDEF KTK_DATA DISK <app folder name>/*.csv
As Waz states, you will need to build a master file description (named KTK_DATA.mas in my example) to read and report from the concatenated data files.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
I believe I remember seeing a technique in the "Techniques You Can Use on Monday" Summit presentation for concatenating groups of flat files with the same naming convention through use of the wild card character (*):
FILEDEF KTK_DATA DISK <app folder name>/elapsed_time-*_2012_06_09.csv
or
FILEDEF KTK_DATA DISK <app folder name>/elapsed_time-*.csv
or
FILEDEF KTK_DATA DISK <app folder name>/*.csv
As Waz states, you will need to build a master file description (named KTK_DATA.mas in my example) to read and report from the concatenated data files.
When I first got the request for this functionality from the finance department I said it could take wild cards. As I also remember it from summit.
I think the hurdles will be to map the location as it is on a NAS, on a different domain then my WF server.
I just have get it to the point where the data is available to my MRE users. I am just the admin, not so much a report writer.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
I reference a drive which is mapped to the WF server and contains various named files with the same format. My functionality allocates the filenames as a dropdown option within the procedure. However, the following shows how we access and create a hold containing all the file names. You may be able to use something like this within a dynamic use statement?
DOS dir DRIVE:\folder\folder\* /b /s /o:-d /on > TEMP.FTM
FILEDEF TEMP DISK TEMP.FTM
FILEDEF MASTER DISK TEMP.MAS
-RUN
-WRITE MASTER FILENAME=TEMP, SUFFIX=FIX , $
-WRITE MASTER SEGMENT=SEG01, SEGTYPE=S1, $
-WRITE MASTER FIELDNAME=FILEN, ALIAS=E01, USAGE=A255, $
SET PAGE-NUM = OFF
DEFINE FILE TEMP
MASTER_NAME/A50=GETTOK(FILEN,255,-1,'\',50,'A50');
FIRST16/A16=EDIT(MASTER_NAME,'9999999999999999');
DDLIST/A255='<select name="mydropdown"><option value="'|MASTER_NAME|'">'|MASTER_NAME|'</option></select>';
OPTFILE/A255 = '<option>'|MASTER_NAME;
MASTER_3/A50=EDIT(MASTER_NAME,'$$999999');
NOPTFILE/A255 = '<option>'|MASTER_3;
END
TABLE FILE TEMP
PRINT NOPTFILE
WHERE MASTER_NAME CONTAINS 'csv'
ON TABLE HOLD FORMAT ALPHA AS DYNAMLST
END
81.05 All formats
Posts: 56 | Location: Manchester | Registered: November 21, 2006
The usage demonstrated by PBax is a good one, however I would recommend using the SYSTEM function to run the system command string as it will capture the return code in a variable allowing you to identify whether your request was a success or not.
I will also wait until the system command has completed before allowing WebFOCUS to continue with processing (it's also dialogue manager with eveything that im[plies). The advantage of this comes when you have a large directory full of files such as c:\windows\system32.
I have the ODBC connection done using the microsoft text driver. When I click test I can see the 3 csv files in the folder.
I have added an adapter under ODBC in the WF server console and built a synonym. When I run the test on the synonym it shows each of the 3 files in the directory as a table.
These files have no field names in the header. They are formated for the peoplesoft import so I can not make any changes to the actual file.
I can see it as a datasource in the MRE report assistant, but it looks like it is only reading one of the 3 files.
I think I am missing a step.
I need a MFD to read all the files in the directory as a single datasource?
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
I can see the datasource in the MRE datasource list. But trying to run a report using some of the field generates errors:
(FOC1394) CONNECT FAILURE (1400) SQLCODE 160 : [IM003] Specified driver could not be loaded due to system error 1114 (Microsoft Text Driver (*.txt; *.csv)). L (FOC1406) SQL OPEN CURSOR ERROR.
Kinda strange since the test worked each step of the way.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
WF allows you to use wildcard characters to read multiple flat files with 1 table file. It creates parameters in the .mas and .acx that have a default, or can be changed at runtime to identify a different file pattern. No need to concat etc.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
I surprised myself this morning by getting this working for the most part. The above error was a security issue and the MRE account did not have the correct right to access the data.
I have it all working and can build reports using the data.
But it is only ready the one file I checked when I built to the synonym. But I am a lot closer than I thought I would be.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
Originally posted by Greg: So something like this in the filedef:
APP FI ELAPSED_TIME DISK //network/location/offlatfiles/elasped_time*.csv
No. I did not say anything about FILEDEF. Read the doc and build a sample synonym from the server console. Read the screens carefully and it will guide you through the process.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Originally posted by Greg: ...But it is only read[ing] the one file I checked when I built to the synonym. But I am a lot closer than I thought I would be.
I think I am doing something similar in my process. I have 6 different csv's in 6 different subdir structures. They are all exactly the same layouts/field sizes, etc, just segmented by hospital entity (in my case).
SET ASNAMES = ON
SET PCOMMA = ON
-SET &FILEPATH = '\\Server\';
-******************************************************************************
-SET &BED_FILE = 'HOSP1\BEDS.csv';
-SET &FULLFILENAME = &FILEPATH | &BED_FILE;
FILEDEF VHS_BEDS DISK "&FULLFILENAME"
TABLE FILE VHS_BEDS
PRINT
HOSPNAME
SERV_AREA_ID
BED_LABEL
DEPT_ABBREVIATION
BED_NOTES
BED_AVAILABILITY
BY DEPT_ABBREVIATION NOPRINT
BY BED_LABEL NOPRINT
ON TABLE HOLD AS FILE1
END
-******************************************************************************
-SET &BED_FILE = 'HOSP2\BEDS.csv';
-SET &FULLFILENAME = &FILEPATH | &BED_FILE;
FILEDEF VHS_BEDS DISK "&FULLFILENAME"
TABLE FILE VHS_BEDS
PRINT
HOSPNAME
SERV_AREA_ID
BED_LABEL
DEPT_ABBREVIATION
BED_NOTES
BED_AVAILABILITY
BY DEPT_ABBREVIATION NOPRINT
BY BED_LABEL NOPRINT
ON TABLE HOLD AS FILE2
END
This what you're aiming for? Using the same synonym to read multiple files dynamically? -ABT
All my files are in the same directory, and the names all start with the same 'elasped_time-' and end with .csv. The format of the files are identical.
All 25 fileds are seen as F1 thru F25 and all are A255. I need F5 to be YYMD and F11 to be d12.1S. But when I try to define them that way and add them to the report the report fails. Says fields unrecognized.
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL
So, if I have a series of file that are csv with a deliminator of ; and no headings, here is the master when I build the meta data via the console and answer the correct questions:
Now, if I do nothing and use this as the source in a report - or whatever - the process will automatically concatenate all file that match the pattern:
baseapp/car_output_*.ftm
If I change the values of any of the GLOBAL variables, then I can completely change the source file settings.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
TABLE FILE ELAPSED_TIME_CSV PRINT 'ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F3' AS 'EMP ID' 'ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F5' AS 'Date' 'ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F11/D12.1S' AS 'Hours' HEADING "Kronos Export Integrety Check" FOOTING "&DATEMDYY <+0> " ON TABLE SET PAGE-NUM OFF ON TABLE COLUMN-TOTAL AS 'TOTAL' 'ELAPSED_TIME_CSV.ELAPSED_TIME_CSV.F11' ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ (I removed the stuyle stuff for this post) ENDSTYLE END [/code]
I tired to add the other and conenction infomation to the ACX like in dhagen's post above but it failed.
If I change the suffix to COM , $ (so I can use PCOMMA I got no records returned.
I feel I am close to getting this working.
UPDATE: I have it reading more than the first record.This message has been edited. Last edited by: Greg,
prod: WF 7.7.03 platform IIS on Windows 2007, databases: Oracle, , MSSQL