Table Conversion from multiple text files

Sef

Sef

VIP Member
Hi All,

The table conversion tool facilitates the conversion of data in text format directly into One World tables. I now have the need to convert a number of identically structured text files into the one One World table (the text files are supplied per state rather than consolidated). However the TC tool only allows one file name. Also when I try to copy one TC UBE into another and change the input file name, all ER and File format information is deleted, so I need to design 8 (one for each state) quite involved UBE's.

The alternative is to rename the text file every time prior to running the TC UBE, but this seems rather cumbersome. And consolidation is also quite tricky as each file contains two header records which contain information on eg state.

Is there a method where the text file name can be a variable eg dependent on a Processing Option or read from a table? Is there maybe another method I can use?

Any help or tips would be greatly appreciated

Rgds,
 
Yeah, Yeah before people start complaining.....

I really should read the old mails before posting a question (bad behaviour from a moderator!!).

It looks like this topic has already been discussed several times. I'll go back next week and see what the combined brain trust reckons is the best solution, but I am not discouraging people to post their answers here.....

Rgds,
 
Hi Sef,

No problem the re-open an "old" issue.

My answer briefly:

I do not use Table Conversion for a long time.
I use "normal" UBE and our custom conversion BSFNs (e.g. String to Numeric Flexible) and use the Flat File Operations BSFN to handle text files. I had copied the original Flat File Operations BSFN to a custom one and extended with the Read operation.

I always prefer and use fixed field length format - to be on the safe side and making easier the processing.

Advantages:
----------------
1.) More flexibility
2.) Possible to define file names in proc opt or generate it inside the UBE
3.) Possibility of Proof/Final modes
4.) Possibility to produce a printed report too with listings, possible errors and with statistics.
5.) No Text Driver definition, no OneWorld Data Source definition, no new OW Environment to hold the text data source.
6.) No problem with environment when you want to use the TC on different Path Codes (each requires its own Environment to hold the text ds)
7.) Easier to deploy because no need to define text driver on each running location.

That's all.

Regards,

Zoltán
 
Sef,

I _know_ that Zoltan's method is _much_ slicker than this but
I usually use 2 TCs.

The 1st runs over a single line, dummy.txt
It's only purpose is to (bsfn) DELETE OR COPY FLAT FILE
to copy the diff input .txts into the a intermediate .txt that the 2nd tc uses as input.

The 2nd has the file layouts, and does all the processing.

Gene
 
In the Process Begin section I use ClearTextFile in N74W5701 to clear my input file. Then use DeleteOrCopyFlatFile in B4700230 to copy my processing option value to the input file name. Mine are usually run over scheduler overnight, so I don't have to worry about the jobs running into each other. If the ever-so-touchy table conversions can run on a single threaded que, that would solve that problem. If it were a problem for you. "Ever-so-touchy table conversions" is probably why a lot of people use Zoltan's suggestion, though.
 
Hi Gene,

Not bad method!

Just a question: Why are both UBE Table Conversion?
IMHO the outer one could be a "normal" UBE which can capture the actual file name from Pro Opt.

Regards,

Zoltán
 
Zoltan,

I think I did it as I was in a TC mindset at the time and brain-dead to any other ideas. The ube would work as well, if not better.

Gene

PS - WELCOME BACK, your presence was missed.
 
Casey,

As simple solution as GREAT!
Sef will be glad to read it.

I know, sometimes the TC way is the simplier way.

Regards,

Zoltán
 
Hi Casey, Gene & Zoltan

Thanks sooooo much for your help. It's all too easy once you know about those two little business functions. Just had a play in PY and succesfully created a UBE with processing options for file names and a call to the TC, where the flat files are copied in the 'Process Begin' ER.

Thanks again,
 
Back
Top Bottom