How to create a vsam file from a flat file?

Showing Answers 1 - 6 of 6 Answers

jayakumar

  • Sep 9th, 2006
 

STEP1:Sort the input flat file in an ascending sequence//step1 exec pgm=sort//sysout dd sysout=*//sysin dd * sort fields=(starting location of the key field,length in bytes,sort seq(asc or desc),format(ch))/*step2;create the VSAM cluster using idcams//step2 exec pgm=idcams//sysprint dd sysout=*//sysin dd *define cluster(name(your.base.cluster) -volumes(*) - keys(length in bytes,starting position of key field) - recordsize(avg,max) -freespace(20 ,20)) - data(name(your.base.data) -)index(name(your.base.index) -controlintervalsize(4096)))Step3:Use repro to load the flat file to vsam file//step3 exec pgm=idcams.//sysprint dd sysout =*//sysin dd *REPRO INDATASET("FLAT FILE") OUTDATASET("YOUR BASE CLUSTER FILE")//

  Was this answer useful?  Yes

manoj

  • Sep 29th, 2006
 

Actually , the question asked how to create vsam file from a flat file,

 let me clear we can not create flat file to vsam dataset, only we can copy records of flat file to vsam dataset using repro command.

 the above example shows copy of flat file to vsam not conversion.

thanks

manoj

  Was this answer useful?  Yes

TUSHAR

  • Oct 27th, 2006
 

yes manoj is right.

  Was this answer useful?  Yes

Shrikant

  • Mar 30th, 2007
 

No Jayakumar is right, that is the way of conversion of flat file to KSDS. First sort, then copy to KSDS.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions