MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Copying data from VSAM to flatfile

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Wed Nov 03, 2004 4:31 am    Post subject: Copying data from VSAM to flatfile Reply with quote

Hi,

Is there any way of copying data from a VSAM file to flat file using file-aid? I am able to do it using in FPRINT command, but it works only in formatted view.

Thanks,
Ranjish
Back to top
View user's profile Send private message  
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Wed Nov 03, 2004 6:21 am    Post subject: Reply with quote

Ranjish,

If your aim is to just copy the contents of the vsam file to a falt file then you can use the following file-aid jcl

Code:

//STEP0100 EXEC PGM=FILEAID,REGION=6M                   
//SYSPRINT DD  SYSOUT=*                                 
//SYSLIST  DD  SYSOUT=*                                 
//DD01     DD  DSN=YOUR INPUT VSAM FILE,
//             DISP=SHR                                 
//DD01O    DD  DSN=YOUR OUTOUT FLAT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE),
//             DCB=(LRECL=ZZZ,RECFM=AA,BLKSIZE=0)
//SYSIN    DD  *                                       
$$DD01 COPY PADCHAR=X'40'                               
/*                                                     


Alternatively you can use Sort also to copy the vsam file.

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD  SYSOUT=*                                 
//SORTIN   DD  DSN=YOUR INPUT VSAM FILE,
//             DISP=SHR                                 
//SORTOUT  DD  DSN=YOUR OUTOUT FLAT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE),
//             DCB=(LRECL=ZZZ,RECFM=AA,BLKSIZE=0)
//SYSIN    DD  *                                       
  SORT FIELDS=COPY
/*                                                     


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu


Last edited by kolusu on Wed Nov 03, 2004 11:10 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website  
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Nov 03, 2004 9:53 am    Post subject: Reply with quote

Kolusu,
A small question,,,among the above which one is the costliest job ?What I mean is which will consume more CPU and Excp count?

Thanks
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message  
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Nov 03, 2004 10:17 am    Post subject: Reply with quote

bprasanna,

File-Aid should be the So-Called Costliest job of the two. Sort consumes extremely less CPU & EXCP.

Thanks,

Phantom
Back to top
View user's profile Send private message  
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Wed Nov 03, 2004 10:59 am    Post subject: Reply with quote

Thanks Kolusu for the solution

Ranjish
Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group