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

Copying a Flatfile to a VSAM file.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mjshaheed

New User


Joined: 09 Apr 2007
Posts: 25
Location: Chennai,India

PostPosted: Mon Feb 25, 2008 3:55 am
Reply with quote

Hi,

I need to copy a flat file to a vsam file which is being created at the time of the run.

Basically i am creating a VSAM file and copying the data from flat file to it.
Can you please tell me if the syntax that follows is correct?

Code:

//LOADSORT EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN01  DD DSN=COL.FLAT.FILE,
//             DISP=SHR
//OUT01 DD DSN=COL.VSAM.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            DCB=LRECL=29,
//            RECORG=KS,KEYLEN=29,KEYOFF=0,
//            UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE)
//SYSIN    DD *
      REPRO  INFILE(IN01) OUTFILE(OUT01) REUSE
//*


Thanks,
Shahul
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 25, 2008 4:42 am
Reply with quote

Hello,

You might need to DELETE/DEFINE the vsam file before you REPRO into it.

There are multiple topics on how to define a vsam file in the forum (use "Search"). Here is the link to one of them:
http://ibmmainframes.com/viewtopic.php?t=17867&highlight=delete+define
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Feb 25, 2008 4:52 am
Reply with quote

Isn't there a REUSE verb for IDCAMS?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Feb 25, 2008 6:26 am
Reply with quote

Off hand, without actually running the code, it looks to me like it should work. Shahul, did you experience any problems with it?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Feb 25, 2008 3:24 pm
Reply with quote

And is the data sorted in key sequence ?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top