Adding Header and Footer Data/Fields for Fixed Width Text File with Text Editor

More
4 years 10 months ago #18751 by cchavez
I have Data Spec that requires us to have a Header Record and a Trailer Record (Footer) for a Fixed Width text file for another company’s input specification.
Question:
How do you use the Text Editor in a fixed width format specification?

Our Header and Footer file has data that is persistent and some data that is dynamic (see attachment).

Are we able to create a environment variable that we can pass into the footer and header?

I saw an example where I saw some tags <data> in an example on the Wiki but couldn’t figure out where it was pulling those variables from.

The record is a fixed block record and should be the first record on the file. Each field is fixed in length and not delimited. The field specifications are as follows:

File Attachment:

File Name: AddingHead...ata.docx
File Size:14 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago - 4 years 10 months ago #18753 by admin
Hello.

We have created a working example for you,
It uses variables

Here are the screenshots.



Actual transformation:

Two metadata objects: one of the is used to get file creation date another record number
Reformat date: changes date format to YYYYMMDD as per your spec.
Running total: calculates SUM.
Left pad: pads "Record Number" with zeros.
(You would need another one for the sum of sales).
Right pad is used to pad the string to 600 characters as per your spec
and the last step sets variables values (Note variable names)



Nex step is to set header and footer


Note variables names



We do have a number of wiki articles dedicated to working with variables.
www.etl-tools.com/wiki/knowledgebase/using_variables?s []=variables

Mike
ETL Architect
Last edit: 4 years 10 months ago by admin.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #18754 by admin
I have attached actual transformation for your convenience.

File Attachment:

File Name: example.zip
File Size:3 KB

Mike
ETL Architect
Attachments:
The following user(s) said Thank You: cchavez

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #18765 by cchavez
We will review and test this afternoon and thank you.

Please Log in or Create an account to join the conversation.

More
4 years 10 months ago #18802 by cchavez
Admin this was a great approach we were able to take this and translate it to a series of the steps.

Please Log in or Create an account to join the conversation.