Easy question

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are many variations on this. Here's just one solution. Note, though, that you need to do these transformations in a Transformer stage; in server jobs a Sequential File stage accesses data in the text file, without modifying it. Version 6 will allow you to pass the data through a filter, such as a sed or awk script.

To get the four characters to the left of the first "]" character:
Right(Field(TheString, "]", 1, 1), 4)

To get the four characters to the immediate right of the first "]" character:
Left(Field(TheString, "]", 2, 1), 4)

Will you need to handle the case that there might not be a "]" character?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Angel
Participant
Posts: 18
Joined: Thu May 29, 2003 8:46 am
Location: Spain

Post by Angel »

Thank you for question.
By
Angel
Participant
Posts: 18
Joined: Thu May 29, 2003 8:46 am
Location: Spain

Post by Angel »

yes, of course, but the problem is that de length before 2000 is not always the same.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For example [Tue Dec 9 2003] versus [Wed Dec 10 2003]. 8)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

ray.wurlod wrote:For example [Tue Dec 9 2003] versus [Wed Dec 10 2003]. 8)
That's why I said most date formats. ;-) Sometimes (especially in UNIX), I would see "Tue Dec 09 2003".

Ah well.

-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
Post Reply