In the 'Mapping Section' of a Transformation file, is it possible to combine the Column Index function with the PAD function?
In our Conversion File, an 'External ID' is derived by concatenating several columns in theTransformation 'Mapping Section' handles:
DATASRC=*COL(23)+*COL(5)+*COL(9)+*COL(3)+*COL(11)+*COL(17)
This produces a string of text such as:
99W8CE01114099999999
With each column separated below by a pipe delimiter:
99|W|8|CE01|1|14099999999
However, some of the fields in the string produced are variable length. This can produce identical strings but in actual fact mean very different things.
I have highlighted the variable length fields below:
DATASRC=*COL(23)+*COL(5)+*COL(9)+*COL(3)+*COL(11)+*COL(17)
If we could PAD the variable length fields this will make our solution more robust.
For example: DATASRC=*COL(23)+*COL(5)+*PAD(Activity_Id,2,L,P)+*COL(3)+*PAD(Size_Id,2,L,P)+*COL(17)
This would produce a string of text such as:
99WP8EM04P114099999999
With each column separated below by a pipe delimiter:
99|W|P8|EM04|P1|14099999999
However, whilst the Trans File validates and processes successfully if a data file is selected as part of the file validation or we proceed to try and Import the actual data, we get the following error:
Task name CONVERT:
No 1 Round:
Command error: PAD(
model: S_AND_OP. Package status: ERROR
Any help would be much appreciated.
Below is a copy of our Transformation File.
*OPTIONS
FORMAT = DELIMITED
HEADER = YES
DELIMITER = ,
AMOUNTDECIMALPOINT = .
SKIP = 0
SKIPIF =
VALIDATERECORDS=YES
CREDITPOSITIVE=YES
MAXREJECTCOUNT=-1
ROUNDAMOUNT=
*MAPPING
ANALYSIS=*NEWCOL(NO_ANALYSIS)
BRAND=*NEWCOL(NO_BRAND)
CATEGORY=*NEWCOL(ACT_MKT_WK)
CUSTOMER=*COL(17)
DATASRC=*COL(23)+*COL(5)+*PAD(Activity_Id,2,L,P)+*COL(3)+*PAD(Size_Id,2,L,P)+*COL(17)
INDUSTRY=*NEWCOL(NO_INDUSTRY)
METRIC=*NEWCOL(MC_MKT)
PRODUCT=*COL(3)+*COL(11)
RPTCURRENCY=*NEWCOL(RC_UNIT)
TIME=*COL(15)+*COL(16)
SUPPLY_SITE=*NEWCOL(NO_SUPPLY_SITE)
SIGNEDDATA =*COL(25)
*CONVERSION
CUSTOMER=MKT_C001.XLS!CUSTOMER
DATASRC=MKT_C001.XLS!DATASRC
PRODUCT=MKT_C001.XLS!PRODUCT
TIME=MKT_C001.XLS!TIME
SIGNEDDATA=MKT_C001.XLS!CONVERSION
Thanks
Ian