Skip to Content
author's profile photo Former Member
Former Member

Filtering out dashes in a routine

I posted this in the BI section but got no responses. I get much faster responses on this forum and while it is BI related, it is a code issue as well. Question is below:

I am trying to get data from one info object that has a data value of Char to another info object that has a data value of Date.

The Char value looks like this: mm/dd/yy hh:mm:ss

The Date value looks like this: dd-mm-yy

When I put the first half of the char value in it does this: -d/d-/yyyy

How do I filter out the dashes in the Char???

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 29, 2007 at 03:39 PM

    Hi,

    May be this way

    replace all occurrences of '-' in text with ' '.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 29, 2007 at 03:40 PM

    you can try like this:

    data: l_char(10) type c value '11/29/2007',
          l_date(10) type c value '29-11-2007'.
    
    replace all OCCURRENCES of '/' in l_char with ' '.
    replace  all OCCURRENCES of  '-' in l_date with ' '.
    
    write: / l_char,
           / l_date.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 08:34 PM

    Thanks guys. Both were spot on, but ass was first.

    Fast forum as always. The answer was posted WAY earlier than this post, but I was doing some testing. THANKS as always.

    Points given.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.