General discussion

Locked

vsam-db2 migration

By babibiet ·
how records from a vsam file can be loaded in to a corresponding db2 table that will be stored as rows in the table and have the same data as in the vsam file?

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by Ed Woychowsky In reply to vsam-db2 migration

VSAM files come in four flavors:
? KSDS ? Keyed Sequence Data Set, corresponds pretty well to a table in a relational database with one or more keys.
? ESDS ? Entry Sequenced Data Set, the sequence of records (rows) is based upon the sequence that the rows where entered, first to last. A relational table with an automatically generated key would do the same thing.
? RRDS ? Relative Record Data Set, records are retrieved by their record number. As with an ESDS, a relational table with an automatically generated key would do the same thing.
? LDS ? Linear Data Set, never used it, so I can?t help you their.

Basically you?ll need to write some kind of program to read each record from the VSAM file and write them to the DB2 table. Depending on the environment the choice of languages available for this task is BAL, C, COBOL, FORTRON and PL/I. While it may not be consider ?Good Programming Practice? if you name the columns the same and use COBOL you can use MOVE CORRESPONDING. You might even be able to use IDCAMS to create a flat file from the VSAM file and work with that.

Collapse -

by babibiet In reply to vsam-db2 migration

this can be done thru load utility. but for that u have to convert the vsam files to sequential files and then use load utility.

this is a one time process.

or else,

u can load one by one row using insert into statement in db2.

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums