View previous topic :: View next topic
|
Author |
Message |
Vayunandanrao
New User
Joined: 22 Mar 2005 Posts: 9
|
|
|
|
hi,
How to copy a flat file or(non Vsam) to VSAM file |
|
Back to top |
|
|
Great Indian
New User
Joined: 05 Apr 2005 Posts: 9
|
|
|
|
You can use IDCAMS REPRO command to load data from QSAM(PS) to VSAM file.
Here is the JCL for your reference.
Code: |
//XDWCOPY JOB (0213),'IDCAMS',CLASS=0,MSGCLASS=Z,
// NOTIFY=&SYSUID
//IN1 DD DSN=PBLT.TEST.PS1,DISP=SHR
//OUT1 DD DSN=PGLT.TEST.KSDS,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(IN1) OUTFILE(OUT1)
/*
// |
NOTE: make sure that duplicates should not be there in primary key....if duplicates exist loading will not be successful. |
|
Back to top |
|
|
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
Hi All,
I have the VSAM file. I want to copy that dataset to Flat file without specifying DCB parameter.
My requirements, Flat file should take the VSAM parameters, without specifying DCB parameter.
Please refer below code:
Code: |
//STEP1 EXEC PGM=IDCAMS
//INDD DD DSN= Input VSAM file name, DISP=SHR
//OUTDD DD DSN= Output Flat file name, DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(2,2)),UNIT=3390
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INDD) OUTFILE(OUTDD)
/* |
|
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Why can't you specify the DCB parameters for the flat file as VSAM file...............
but No idea about the command to copy the attributes of input file out file..........
regards
jai |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi,
Quote: |
I have the VSAM file. I want to copy that dataset to Flat file without specifying DCB parameter. |
We can copy VSAM file into Flat file using IDCAMS utility, but in that we need to mention DCB parameter if file is new.
Hope this helps
Regards
Rupesh |
|
Back to top |
|
|
Pollyannaish
New User
Joined: 09 Jul 2005 Posts: 31 Location: Pune, India
|
|
|
|
Hi
it has been long since i have used this idea.. so not sure whether it will work or not but just give it a try..
DD DSN="new file name",DISP=(NEW,KEEP),
LIKE="a file name for which u want new file to be modelled "
i hope this helps.
if you have any problem let me know.. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I did something like that just today using SORT. But I had to use the DCB to specify that my OP was PS and our shop uses SMS so I didn't need to use SPACE either.
Code: |
//s1 exec sort
//sortin dd dsn=vsam.file, disp=shr
//sortout dd dsn=flat.file,dip=(,catlg,delete),dcb=dsorg=ps
//sortin dd *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I'm not sure why you would need to use DSORG=PS. I would think that would be the default. Perhaps your site is overriding it somehow. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I don't know, Frank. When I tried w/o dsorg I got an ESDS ds as OP.
I assumed that sort copied the IP attributes to the OP ds, but you may be right, the site may have overridden it. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I assumed that sort copied the IP attributes to the OP ds, but you may be right, the site may have overridden it. |
DFSORT would not create a VSAM output data set automatically when it copies a VSAM input data set. A VSAM output data set has to be predefined, or defined via JCL parameters - DFSORT doesn't do that under the covers. I suspect your site has something set up (in the ACS routine, maybe) to define the output data set as an ESDS - that would happen before DFSORT uses it. |
|
Back to top |
|
|
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
Hi All,
Thanks for all your kind help.
My Requirement was, to Copy all the VSAM file to TAPE.
( Since we should not store the VSAM file directly in to TAPE, We need to convert this VSAM file as FLAT file)
Thats the reason i have asked this question.
Finally i have created a REXX tool, for Copying the VSAM file to Flat file without specifying the DCB parameters explicitly.
Thanks for your help. I am doing some correction in that. I will post that once the problem has been properly resolved.
Thanks
Suresh. |
|
Back to top |
|
|
gamarendra
New User
Joined: 12 May 2006 Posts: 13 Location: bangalore
|
|
|
|
Hi,
can't we use
// DCB=(*.VSAMIFile) ??? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
can't we use
// DCB=(*.VSAMIFile) ??? |
I wouldn't think so. A VSAM data set does NOT actually have DCB attributes (e.g. LRECL, BLKSIZE). VSAM data sets use an ACB, not a DCB, and have different attributes (e.g. RECSIZE, CISIZE).
When you copy a VSAM data set to a non-VSAM data set with DFSORT, it sets some of the non-VSAM data set's attributes based on the VSAM data set's attributes by default if appropriate, but it's not a one-to-one correspondence.
I'd be surprised if a referback of the DCB to a VSAM file would be accepted or meaningful. Anybody know different? |
|
Back to top |
|
|
|