cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation file padding

Former Member
0 Kudos

Hello Experts

In the 'Mapping Section' of a Transformation file, is it possible to combine the Column Index function with the PAD function used for padding imported fields?

Through the Transformation File, a string of text is derived by concatenating several columns, see example below:

DATASRC=*COL(23)+*COL(5)+*COL(9)+*COL(3)+*COL(11)+*COL(17)

This produces a string of text such as:

99W8CE01114099999999

Each column is shown using the pipe delimiter:

99|W|8|CE01|1|14099999999

Some fields are variable in length.  This can produce a string of text that may be identical to another but in fact has a very different meaning and should be handled differently by the Conversion File.

Using the same example, those Columns I have highlighted in bold are variable length and need to be padded (to the left) so that they become a fixed length 2 digit field.

DATASRC=*COL(23)+*COL(5)+*COL(9)+*COL(3)+*COL(11)+*COL(17)

Ideally this would produce a string of text like this:

99WP8EM04P114099999999

I have used pipes to separate the constituent parts:

99|W|P8|EM04|P1|14099999999

The letter 'P' is used to Pad the field.

I have tried the following formula but the Transformation File will not validate.

DATASRC=*COL(23)+COL+*PAD(COL(9),2,L,P)+*COL(3)+*PAD(COL(11),2,L,P)+*COL(17)

Any suggestions would be much appreciated.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

Hi Ian,

But what do you mean by (in bold):

DATASRC=*COL(23)+COL+*PAD

Vadim

Former Member
0 Kudos

Sorry, formatting lost when I copied it across...

Using the same example, those Columns I have highlighted in bold are variable length and need to be padded (to the left) so that they become a fixed length 2 digit field.

DATASRC=*COL(23)+*COL(5)+*COL(9)+*COL(3)+*COL(11)+*COL(17)

former_member186338
Active Contributor
0 Kudos

And what do you test?

DATASRC=*COL(23)+*COL(5)+*PAD(COL(9),2,L,P)+*COL(3)+*PAD(COL(11),2,L,P)+*COL(17)

Vadim