How to take the splitted records as seperate records

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
SharingDS
Participant
Posts: 12
Joined: Fri Apr 28, 2006 8:58 pm

How to take the splitted records as seperate records

Post by SharingDS »

Hi Gurus,

I m splitting the single record into two records and after that i wanted to treat these two records as two seperate records

Eg : Source Record :
3,CD,HHHHHHH,16-05-2004,31-12-99994,CD,MMMMMMM,01-01-2002,15-04-2002LastRecord

Splitting this record using Char(10) (Using in between the record based on lengths) and i m getting the output record as

3,CD,HHHHHHH,16-05-2004,31-12-9999
4,CD,MMMMMMM,01-01-2002,15-04-2002LastRecord


Here if i want to take only the last record, it is coming as

3,CD,HHHHHHH,16-05-2004,31-12-9999
4,CD,MMMMMMM,01-01-2002,15-04-2002LastRecord


(Treating splitted record as single record)

But i need only the record 4,CD,MMMMMMM,01-01-2002,15-04-2002LastRecord.

I know i can get the required ouput if i write it into Sequential file and read from there.
But without writing into sequential file is there any ways.....to get the required output.
i.e is there anythig i can use instead of Char(10) for splitting and treat the splitted records as two seperate records.

Kind Regards
Luk
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Write it to a sequential file output and then read it with the new format, but declare this file to be a named pipe so no I/O is done.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

To be really honest, I am confused with what you want. You want to split the records, and you got that part working. Great. Now you dont want the first half of the split record and just want the second half, right? If you always have "LastRecord" as part of data then why not constrant it on that. Or am i completely off track ? :roll:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

If you are using a transformer in the job... why not use a substring or a right function ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Generating the key value in the second row of each pair is straightforward also. Extract the first field from the entre record and add 1 to it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply