URGENT-------------ANY ONE CAN HELP ON THIS Running sequence

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
HariniAruna
Participant
Posts: 12
Joined: Mon Mar 31, 2008 11:39 pm

URGENT-------------ANY ONE CAN HELP ON THIS Running sequence

Post by HariniAruna »

Hi
This is savitha.
How to generate the running sequence number for records.
For example my input is X12 format. My output has to be genrated depending on the number of ST's in input file.
The expected output is :
HDR|1
DTL|2
DTL|3
HDR|4
DTL|5
DTL|6
but iam getting the ouput as
HDR|1
DTL|2
DTL|3
HDR|2
DTL|3
DTL|4

Please any one help to see this one.
Keith
Participant
Posts: 18
Joined: Fri Sep 21, 2007 6:44 am
Contact:

Re: URGENT-------------ANY ONE CAN HELP ON THIS Running sequ

Post by Keith »

So, you have intentions of increasing/making this sequence number every time you hit an ST segment ? It appears that the sequence number for the Header is being added to + 1 while the detail resets and adds +1 to whatever the Header counter is at the time?
Its a little difficult to understand; you will have to explain in much more detail what you are attempting.
Keith
HariniAruna
Participant
Posts: 12
Joined: Mon Mar 31, 2008 11:39 pm

Re: URGENT-------------ANY ONE CAN HELP ON THIS Running sequ

Post by HariniAruna »

Keith wrote:So, you have intentions of increasing/making this sequence number every time you hit an ST segment ? It appears that the sequence number for the Header is being added to + 1 while the detail resets and adds +1 to whatever the Header counter is at the time?
Its a little difficult to understand; you will have to explain in much more detail what you are attempting.
HI
thanks for reply
my map has the input format EDI X12 and output format is the output format.The flat file contains single header and multiple details
For single ST and SE pnly one HDR and multiple DTL has to be generate.
depend on the number of ST and SE the HDr and detail also repeats
For example:
if My input contains only on st and se then
my ouput has to be like
HDR|1|filed3|
DTL|2|filed3|
DTL|3|field3|
DTL|4|field3|

so this is the output format
the first filed is the identifier and the seconf field is the sequence number

Suppose i have multiple ST and SE like 2 ST and SE's in my input then my output should be like

HDR|1|filed3|
DTL|2|filed3|
DTL|3|field3|
DTL|4|field3|

HDR|4|filed3|
DTL|5|filed3|
DTL|6|field3|
DTL|7|field3|

menas the sequence number of the next header has to increment by one from the last seuqence number of DTL .
but iam getting the output as

HDR|1|filed3|
DTL|2|filed3|
DTL|3|field3|
DTL|4|field3|

HDR|2|filed3|
DTL|2|filed3|
DTL|3|field3|
DTL|4|field3|
janhess
Participant
Posts: 201
Joined: Thu Sep 18, 2003 2:18 am
Location: UK

Post by janhess »

Can't tell anything without some idea of the rules you are using. Even my magic crystal ball won't tell me.
wtx_dev
Participant
Posts: 10
Joined: Wed Jul 18, 2007 7:40 am

Post by wtx_dev »

use the INDEX function, while passing the arguments pass as INDEX($).
Post Reply