MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Ranjish Beginner Joined: 22 Dec 2002 Posts: 64 Topics: 28 Location: Chennai
Posted: Wed Nov 03, 2004 4:31 am Post subject: Copying data from VSAM to flatfile
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Wed Nov 03, 2004 6:21 am Post subject:
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
bprasanna Beginner Joined: 05 Sep 2003 Posts: 119 Topics: 33 Location: Hyderabad
Posted: Wed Nov 03, 2004 9:53 am Post subject:
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
Phantom Data Mgmt Moderator Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Wed Nov 03, 2004 10:17 am Post subject:
bprasanna,
File-Aid should be the So-Called Costliest job of the two. Sort consumes extremely less CPU & EXCP.
Thanks,
Phantom
Back to top
Ranjish Beginner Joined: 22 Dec 2002 Posts: 64 Topics: 28 Location: Chennai
Posted: Wed Nov 03, 2004 10:59 am Post subject:
Thanks Kolusu for the solution
Ranjish
Back to top
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