Skip to Content
avatar image
Former Member

Keeping leading zeroes in flat file

I am loading data from a flat file to a DSO.

One of the columns in the flat file is data type CHAR with a length of two. The data values will be either 01, 02 or 03.

When I load the data, the leading zeroes are dropped. Thus, I see 1, 2 and 3 in my DSO. How can I prevent this happening?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jun 24, 2010 at 01:37 PM

    You can either change the number format to text format in the excel sheet and then try to load the data.

    Or concatenate the value 0 to the field value in transformation (update rule/transfer rule) using a routine. Then load the data.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 24, 2010 at 02:28 PM

    Hi,

    Right Click on that column in Excel file and Formate Cells >Custome> Under Type give "00" and then give the values in column like 01 , 02 .... and save as .csv and close it, immediatly load it, DON"T OPEN FILE, because , if you open it will reset to 1, 2... SO again you need to Right click.....and formare cells..

    Thanks

    Reddy

    Edited by: Surendra Reddy on Jun 24, 2010 4:28 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 29, 2010 at 01:06 PM

    Create an InfoObject zyourfield and add it to your DSO.

    Then create a fieldroutine in the transformation / update rule:

    data: zyourfield type /bic/oizyourfield.

    if source_fields-zyourfield ne ''.

    write source_fields-zyourfield +6(2) to h_zyourfield right-justified.

    overlay h_zyourfield with '00'.

    result = h_zyourfield .

    endif.

    This should do the trick, good luck!

    Add comment
    10|10000 characters needed characters exceeded