sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Tue Mar 01, 2005 5:10 am Post subject: Updating Cobol File Content by looking-Up a DB2 table |
|
|
Hi,
My need is to write to a file. The program is already in place but requires a modification as below:
Th program as of now creates a blind dump of whatever is there from some 10+ tables and writes to a file.
The requirement now is, while fetching the rows from a table (T1) to write to a file, I need to check an attribute for a null date (0001-01-01). If this is there then I need to look-up another table (T2) read an attribute value from there and write with the new value in the file. NO values is updated in the table. Only while writing to the file, I need to fetch the value from T2 based on a key.
If I read from T1 data like below:
01
0001-01-01
From T2 I need to find out for 01:
01
2004-01-01
and while writing this in file for dump of T1 that should look like:
012004-01-01 instead of 010001-01-01
This is pretty straight forward but since I am to Mainframe from Unix, I am bit confused about how we defiine all the divisions, sections so on..
So if any of you Cobol Guys out there can helpout on this will be of great help. A sample cobol pgm for similar scenario would help. I can visualize what is required but not able to put together the bits and pieces
Thanks |
|