how to print below requirement

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

how to print below requirement

Post 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
Amar
aravindunni31
Participant
Posts: 27
Joined: Mon Jul 09, 2012 6:51 am
Location: Chennai

Post by aravindunni31 »

Which Version are you using?
Regards,
Aravind V A
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

Post by amar.v023 »

Hi ,
DS version is 8.1
Amar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

Post 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..
Amar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

Post by amar.v023 »

will get data from source daily around 500k records.
Amar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, in other words small and easily handled by a Server job. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
amar.v023
Participant
Posts: 17
Joined: Thu Nov 19, 2009 12:55 am
Location: Hyderabad

Post by amar.v023 »

Please let me know , how to proceed , its urgent.. thanks in advance
Amar
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm on vacation. Nothing is urgent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
aravindunni31
Participant
Posts: 27
Joined: Mon Jul 09, 2012 6:51 am
Location: Chennai

Post 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. ...
Regards,
Aravind V A
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

ray.wurlod wrote:I'm on vacation. Nothing is urgent. ...
You're not helping, Ray... ;-)
bhasds
Participant
Posts: 79
Joined: Thu May 27, 2010 1:49 am

Post 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.
aravindunni31
Participant
Posts: 27
Joined: Mon Jul 09, 2012 6:51 am
Location: Chennai

Post 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.
Regards,
Aravind V A
Post Reply