Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 07 May 2004 @ 12:55:13 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Fast Export case and concatenation
 
From:   Geoffrey Rommel

  1) Is there a way of padding a field with trailing or leading spaces in Fastexport on MVS?  


Just pad it in your select. For instance, if you want a column to be padded to a constant length of 35 bytes, select cast(column1 as char(35)). You can also concatenate spaces as needed, but be sure to cast the result to fixed-length. See the answer to the next question.


  2) I want to concatenate one field that is the result of a case expression with a '00' and concatenate another field at the end of that i.e. <result of case>00<field 2>. This is on MVS. When using a case statement and concatenation in Fast export, the resulting output file has two dots (i.e. '..') before the first field. Is there a way of avoiding this?  


Those are not two dots; they are the field length in binary, as you can see if you turn hex on. This is because the result of case expressions by default is VARCHAR. To avoid this, cast the entire expression as fixed-length, like so:

select (case ... end)||'00'||field2 (char(40))



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023