Page 1 of 1

how to print below requirement

Posted: Tue Nov 06, 2012 11:11 pm
by amar.v023
Hi

I have a seq file like below with 2 rows, 123 should print 4 times....same 456 print 3 times
A, B
123,4
456,3
i want out put as below please let me any suggestions. Thanks
A
123
123
123
123
456
456
456

Posted: Tue Nov 06, 2012 11:53 pm
by aravindunni31
Which Version are you using?

Posted: Wed Nov 07, 2012 12:25 am
by amar.v023
Hi ,
DS version is 8.1

Posted: Wed Nov 07, 2012 2:35 am
by ArndW
Since transform loops, which would solve your problem, are only available in later releases that solution cannot be used. What is the maximum number that can be in Column B? If it is a known, and small, number {n} you could make a transform stage with {n} outputs each coupled to a constraint that would multiply your rows relatively easily.

Posted: Wed Nov 07, 2012 3:05 am
by amar.v023
Thanks your replay ArndW,

But we can't say what is MAX,small numbers.. any numbers will get from input file... this is main problem to solve..

Posted: Wed Nov 07, 2012 3:09 am
by ArndW
I can't think of an easy direct way to do this in a PX job offhand. It isn't difficult to do with a Server job. How big is your data volume?

Posted: Wed Nov 07, 2012 7:29 am
by amar.v023
will get data from source daily around 500k records.

Posted: Wed Nov 07, 2012 8:04 am
by chulett
So, in other words small and easily handled by a Server job. :wink:

Posted: Wed Nov 07, 2012 8:09 am
by amar.v023
Please let me know , how to proceed , its urgent.. thanks in advance

Posted: Wed Nov 07, 2012 8:55 am
by ArndW
I am in an urgent project right now and with 14-16 hour days I don't have much spare time and energy to approach such problems. Considering that my solution, if any, would be posted as premium content you should at least consider getting a premium membership. Note that "urgent" or "ASAP" for responses doesn't go down well with the volunteers who log into this forum (particularly considering what some of them get as an hourly wage) and the pro bono publico work isn't remunerated.

Posted: Wed Nov 07, 2012 2:59 pm
by ray.wurlod
I'm on vacation. Nothing is urgent.

Posted: Wed Nov 07, 2012 9:55 pm
by aravindunni31
Hi Amar,
Try this.

Write the data to a Dataset. Then use a unix script. In that script, call orchadmin commands and save Columns A and B in different arrays. Create a for loop like structure, call records in one loop and then create another loop to print the records to file based on B column's value. This is the only option i found.
ray.wurlod wrote:I'm on vacation. Nothing is urgent. ...

Posted: Wed Nov 07, 2012 10:19 pm
by stuartjvnorton
ray.wurlod wrote:I'm on vacation. Nothing is urgent. ...
You're not helping, Ray... ;-)

Posted: Thu Nov 08, 2012 1:46 pm
by bhasds
Hi Stuartjvnorton,

Try the below-

In the output derivation for A in trnsformer-

Code: Select all

str(A:"|",B)
In the target sequential file Filter option-

Code: Select all

tr -s '|' '\n'
Please let me know if you are getting the desired output.

Posted: Thu Nov 08, 2012 11:13 pm
by aravindunni31
Thanks yaar. Its a nice option. Tried to create file. Yet to run the unix part. Will update you all.. This works Amar. Try it.