Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to COPY VSAM file to FLAT file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Vayunandanrao

New User


Joined: 22 Mar 2005
Posts: 9

PostPosted: Wed Apr 06, 2005 2:21 pm    Post subject: How to copy a flat file to VSAM file
Reply with quote

hi,
How to copy a flat file or(non Vsam) to VSAM file
Back to top
View user's profile Send private message

Great Indian

New User


Joined: 05 Apr 2005
Posts: 9

PostPosted: Wed Apr 06, 2005 3:17 pm    Post subject:
Reply with quote

You can use IDCAMS REPRO command to load data from QSAM(PS) to VSAM file.

Here is the JCL for your reference.

//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
View user's profile Send private message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Thu May 25, 2006 8:37 pm    Post subject: How to COPY VSAM file to FLAT file
Reply with quote

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:

//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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Thu May 25, 2006 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Fri May 26, 2006 9:35 am    Post subject: Re: How to COPY VSAM file to FLAT file
Reply with quote

Hi,

Quote:
I have the VSAM file. I want to copy that dataset to Flat file without specifying DCB parameter.


W 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
View user's profile Send private message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Fri May 26, 2006 11:19 am    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 27, 2006 5:27 am    Post subject:
Reply with quote

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.

//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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat May 27, 2006 8:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat May 27, 2006 8:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun May 28, 2006 8:23 pm    Post subject:
Reply with quote

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
View user's profile Send private message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Tue May 30, 2006 3:32 pm    Post subject: Re: How to COPY VSAM file to FLAT file
Reply with quote

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
View user's profile Send private message
gamarendra

New User


Joined: 12 May 2006
Posts: 13
Location: bangalore

PostPosted: Thu Jun 01, 2006 12:24 am    Post subject: Re: How to COPY VSAM file to FLAT file
Reply with quote

Hi,
can't we use

// DCB=(*.VSAMIFile) ???
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jun 01, 2006 1:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts editting the file by inserting zeros ... pramodrsingh DFSORT/ICETOOL 9 Mon Aug 21, 2017 5:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us