IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sample cobol program for database load


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Mon Mar 20, 2006 10:44 am
Reply with quote

Hi all,

1. I need a sample cobol program which takes in the data from the file, reformats it and loads it into the database.
2. Also need a sample cobol program which converts the date from one format to another.



Thanks in advance,
Sripriya.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Mar 20, 2006 10:47 am
Reply with quote

sripriya,

Quote:
1. I need a sample cobol program which takes in the data from the file, reformats it and loads it into the database.

Loads into which Database ?????

Quote:
2. Also need a sample cobol program which converts the date from one format to another.

Pls give an example...which format to another ???

Regards,
Priyesh.
Back to top
View user's profile Send private message
sripriya

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Tue Mar 21, 2006 10:17 am
Reply with quote

Hi,

To explain it in brief.
There is a unix server with the files. The data in the files should be uploaded into the mainframe database. The file in the unix server has to be ftped into the mainframe file, this file is to be read first and then the data in the file has to be reformatted using syncsort and then it should be loaded into the mainframe DB2 database. In short the unix database is to be converted to mainframe database.


Sripriya.
Back to top
View user's profile Send private message
cheryala

New User


Joined: 20 Mar 2006
Posts: 46

PostPosted: Tue Mar 21, 2006 11:19 am
Reply with quote

Hi Sripriya,

For loading a formated data from a file into database table ..i don't think a cobol program is needed until you are going to do some enrichment of the records..You can use IBM supplied utilities to load the data in file to a table ..

Please let me know if you have any concerns..

Cheers
RSC
Back to top
View user's profile Send private message
aru_bec

New User


Joined: 23 Dec 2005
Posts: 19
Location: Bangalore

PostPosted: Tue Mar 21, 2006 11:21 am
Reply with quote

Sripriya,

U can use the following JCL to FTP file from Unix to Maiframe

//FTPJOB1 JOB
//MYFTP EXEC PGM=FTP,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*
//MYDD DD DSN=INPUTFILE,
// DISP=(NEW,CATLG,DELETE),
// DCB=(As per requirement)
// SPACE=(As per requirement)
//OUTPUT DD SYSOUT=*
//INPUT DD *
Unix Server name
USer ID
Passwd
ascii
cd <location of the file , i mean directory>
get <filename> //DD:MYDD
quit
/*


Process the INPUTFILE using sort then using Cobol program load it to DB2.

Hope this helps you.

Regards,
Arvind
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top