Hi Peter,
yes, correct :-)
Just change the CAST from ANSI to Teradata syntax, ANSI casts numeric values left aligned whereas Teradata does it right aligned:
A.BestNr (CHAR(13))
Caution, if the maximum number of characters (based on the column's FORMAT) is greater than 13 this cast will strip some digits.
Assuming BestNr is a numeric column you might simply add a FORMAT:
A.BestNr (CHAR(13), FORMAT 'Z(13)')
Btw, you don't have to use a SubString and Cast unless you want to extract a specific portion of the string.
And you don't have to concat all the columns, you probably do it because you don't want do all those (TITLE ''):
Change EXPORT REPORT to
EXPORT DATA followed by SET RECORDMODE OFF
This omits the title plus the titledashes (undocumented but quite nice)
If you don't want blanks between columns you can SET SEPARATOR '' or SET SEPARATOR 0
And finally: instead of typecasing to char/substring you might better add FORMATs, thus you got better control over the formatting (and REPORT format automatically applies the cast to char)
Dieter
Hi Peter,
yes, correct :-)
Just change the CAST from ANSI to Teradata syntax, ANSI casts numeric values left aligned whereas Teradata does it right aligned:
A.BestNr (CHAR(13))
Caution, if the maximum number of characters (based on the column's FORMAT) is greater than 13 this cast will strip some digits.
Assuming BestNr is a numeric column you might simply add a FORMAT:
A.BestNr (CHAR(13), FORMAT 'Z(13)')
Btw, you don't have to use a SubString and Cast unless you want to extract a specific portion of the string.
And you don't have to concat all the columns, you probably do it because you don't want do all those (TITLE ''):
Change EXPORT REPORT to
EXPORT DATA followed by SET RECORDMODE OFF
This omits the title plus the titledashes (undocumented but quite nice)
If you don't want blanks between columns you can SET SEPARATOR '' or SET SEPARATOR 0
And finally: instead of typecasing to char/substring you might better add FORMATs, thus you got better control over the formatting (and REPORT format automatically applies the cast to char)
Dieter