Page 1 of 1

Oracle table to cobol file output

Posted: Thu Feb 26, 2015 12:09 pm
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?

Posted: Sun Mar 01, 2015 5:41 am
by priyadarshikunal
all depends on the the way that layout is defined.

PS you may have to join instead of funnel.

Re: Oracle table to cobol file output

Posted: Sun Mar 01, 2015 3:57 pm
by ray.wurlod
udayanguha wrote:CFF stage. Will this take care of everything like packed decimal etc?
Yes. If configured correctly.

Posted: Tue Mar 03, 2015 2:27 pm
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?

Posted: Wed Mar 04, 2015 1:58 pm
by sharmabhavesh
Hi,
Any help on this? Even I am facing a same scenario with one of my code pieces.

Posted: Wed Mar 04, 2015 3:51 pm
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.

Posted: Wed Mar 04, 2015 10:16 pm
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.

Posted: Wed Mar 04, 2015 11:02 pm
by ray.wurlod
"quite similar" <> "identical"

Posted: Thu Mar 05, 2015 2:50 pm
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 :).

Posted: Thu Mar 05, 2015 3:01 pm
by udayanguha
Any help on my issue? Probably it could help 2 people now :):)!!!

Posted: Fri Mar 06, 2015 8:13 am
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.