GeekInterview.com
Series: Subject: Topic:
Question: 30 of 44

How to create a vsam file from a flat file?

Asked by: Interview Candidate | Asked on: Aug 24th, 2006
Showing Answers 1 - 4 of 4 Answers
jayakumar

Answered On : 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")//

  
Login to rate this answer.
manoj

Answered On : 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

  
Login to rate this answer.
TUSHAR

Answered On : Oct 27th, 2006

yes manoj is right.

  
Login to rate this answer.
Shrikant

Answered On : Mar 30th, 2007

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

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.