Oracle table to cobol file output

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
udayanguha
Premium Member
Premium Member
Posts: 37
Joined: Wed Oct 29, 2014 10:48 pm
Location: Ohio

Oracle table to cobol file output

Post by udayanguha »

Hi,
I have different oracle tables like:
-Policy info
-Vehicle info
-Driver info
-Insured info

I want to extract data from all these tables and put it in a cobol payout where data will be like
-policyinfo
-Corresponding vehicle info
-Corresponding driver info
-corresponding insured info

So my target file would not have a single format. Infact there will be corresponding records for each policy in the same file. I have a copybook as well for the target. Do I need to funnel all these seperate records from input and put it into a CFF stage. Will this take care of everything like packed decimal etc?
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

all depends on the the way that layout is defined.

PS you may have to join instead of funnel.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Oracle table to cobol file output

Post by ray.wurlod »

udayanguha wrote:CFF stage. Will this take care of everything like packed decimal etc?
Yes. If configured correctly.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
udayanguha
Premium Member
Premium Member
Posts: 37
Joined: Wed Oct 29, 2014 10:48 pm
Location: Ohio

Post by udayanguha »

Hey priyadarshikunal,
If suppose I have a policy and 2 corresponding named insured for the policy. My policy record in the source is:
Pol_No, Transaction_dt
1234,20150102

Corresponding named insured records are:
Policy_no,F_Name,LName
1234,FNAME1,LNAME1
1234,FNAME2,LNAME2

What I want in my output is like
POL123420150102
INSFNAME1LNAME1
INSFNAME2LNAME2


where first 3 characters in the record tell the record type (POL for Policy, INS for named insured)
Now if you see I have 2 different record layouts in a single file. How do you suggest joining the data and in what layout should I present the data to CFF target stage?
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Post by sharmabhavesh »

Hi,
Any help on this? Even I am facing a same scenario with one of my code pieces.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

sharmabhavesh wrote:Any help on this? Even I am facing a same scenario with one of my code pieces.
And what have YOU tried? Is your requirement identical to udayanguha's? If not, you should really start your own thread.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Post by sharmabhavesh »

Yes, my problem is similar to UdayanGuha. I couldn't try much as I could not understand how to convert the different file records in a COBOL format. When I put the transformer between sequential file and CFF stage, I could not map the fields.
But yes, Udayanguha's scenario is quite similar to my problem.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"quite similar" <> "identical"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sharmabhavesh
Premium Member
Premium Member
Posts: 38
Joined: Tue Jun 19, 2012 11:03 pm
Location: India

Post by sharmabhavesh »

Yes, quite similar is not identical. His is an insurance domain while mine is a banking domain. So the fields might be different but the transformation he is looking for is the same I am looking for.

If you still think I need to create a new thread, I will do that. But I think solution to his problem will give me sufficient input to solve my issue :).
udayanguha
Premium Member
Premium Member
Posts: 37
Joined: Wed Oct 29, 2014 10:48 pm
Location: Ohio

Post by udayanguha »

Any help on my issue? Probably it could help 2 people now :):)!!!
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Uday,

You have two distinct design issues. The first should be solved in the Oracle table extract, where you link (key is policy number?) the records to be joined. Take a close look at doing this in your Oracle processes rather than in DataStage.

The second is mapping to your Cobol copybook. Your choice of stages is for the type of transformations you need, not for the Cobol formatting. Cobol copybook is going to be on your final output stage.

First step is to use the Table Definition import wizard to create your TD from the copybook text file. Next is to line up your type conversions to make sure your data is passed accurately. Finally, you need to look at your method for moving the file to the Cobol environment. All of that is technical for your platforms, not specific to DataStage.

You'll find general help on the FAQ here at viewtopic.php?t=143596 -- Using Mainframe Data. As you progress and find issues in the details, if the FAQ doesn't help post here and I (and others) might be able to help.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply