Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Ways to load data in to a VSAM file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Wed Oct 31, 2007 12:44 pm    Post subject: Ways to load data in to a VSAM file
Reply with quote

Hi All,
I have allocated a VSAM cluster and i want to load data in to that....
Quote:
Can anyone please tell me what are all the possible ways that one can load data in to the VSAM cluster.


In my case, i want to use this VSAM file in a cobol pgm, which is required to add, modify, delete recs from that VSAM file.

This is the layout for that VSAM file..
    EMP NUMBER NUMERIC 6
    EMP NAME ALPHATIC 30
    DESIGNATION CODE NUMERIC 2
    PROJECT CODE NUMERIC 2
    BASIC PAY NUMBERIC 6


Quote:
Note EMP NUMBER is the primary key


How to make this primary key ??

Can anyone please help me in this?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Oct 31, 2007 12:48 pm    Post subject:
Reply with quote

Gopal,

Quote:
Can anyone please tell me what are all the possible ways that one can load data in to the VSAM cluster.

Utils like IDCAMS, SORT and Programs.

Quote:
How to make this primary key ??

Use KSDS cluster.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Wed Oct 31, 2007 12:55 pm    Post subject:
Reply with quote

Hello murmohk1,

Quote:
Use KSDS cluster.


Can you please tell me more abt this??

Thank you,
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Oct 31, 2007 1:00 pm    Post subject:
Reply with quote

Gopal,

Quote:
Can you please tell me more abt this??

I believe, this is the BEST TIME (for you) to refer some manual.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Wed Oct 31, 2007 2:11 pm    Post subject:
Reply with quote

Thanks for ur assistance!!!!

Will refer some manual....!!!!
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 12:31 pm    Post subject: Hi........
Reply with quote

Hi,


To load the VSAM data set, you can use REPRO command, for this you have to create sequential dataset of same field length and name and use REPRO-COPY command it will loads the VSAM dataset.........




Regard's

Vasanth......... icon_smile.gif
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Nov 01, 2007 12:42 pm    Post subject:
Reply with quote

Vasanth,

Quote:
you have to create sequential dataset of same field length and name and use REPRO-COPY command it will loads the VSAM dataset.........


Why do you need same name? Also where can I get REPRO-COPY command syntax.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 12:55 pm    Post subject:
Reply with quote

Hi Murli,


You can use this syntax in JCL


//SYSIN DD *
REPRO-
COPY-
INDATASET("SEQUENTIAL DATASET NAME")- [this data set contains the records to be loaded in to the VSAM data set)
OUTDATASET("VSAM DATASET NAME")-
/*

Regard's
Vasanth...... icon_smile.gif
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 01, 2007 12:56 pm    Post subject: Hi murmohk1
Reply with quote

murmohk1 wrote:
Vasanth,

Quote:
you have to create sequential dataset of same field length and name and use REPRO-COPY command it will loads the VSAM dataset.........


Why do you need same name? Also where can I get REPRO-COPY command syntax.


Hi murmohk1

REPRO command is one of the option under IDCAMS utility

you can use this way

---------------------------------------------
//KSDLOAD1 JOB (A123), 'raghu'
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//DDIN DD DSN=FILE1.TEST,DISP=SHR
//DDOUT DD DSN=VSAM1.KSDS.CLUSTER,DISP=OLD
//SYSIN DD *
REPRO -
INFILE (DDIN) -
OUTFILE (DDOUT)
/*
//

On execution, It will load information which is present in DDIN(ie DATA SET FILE1.TEST ) to DDOUT(ie VSAM1.KSDS.CLUSTER)

Only pre requist is that FILE1.TEST should be arranged on ascending order about the field which is defined as primary key in KSDS while allocation

Raghav
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 1:00 pm    Post subject:
Reply with quote

Hi Revel,


Thanks for your sugsesstion too..

Regard's
Vasanth........ icon_smile.gif
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Nov 01, 2007 1:04 pm    Post subject:
Reply with quote

Vasanth,

Try your card and let us know the return code.

Raghav,

Thanks for the info. But I suggest you to go thru the manuals for the prerequistes (as said by you).
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 01, 2007 1:09 pm    Post subject: Re: Ways to load data in to a VSAM file
Reply with quote

ursvmg wrote:
Hi All,
I have allocated a VSAM cluster and i want to load data in to that....
Quote:
Can anyone please tell me what are all the possible ways that one can load data in to the VSAM cluster.


In my case, i want to use this VSAM file in a cobol pgm, which is required to add, modify, delete recs from that VSAM file.

This is the layout for that VSAM file..
    EMP NUMBER NUMERIC 6
    EMP NAME ALPHATIC 30
    DESIGNATION CODE NUMERIC 2
    PROJECT CODE NUMERIC 2
    BASIC PAY NUMBERIC 6


Quote:
Note EMP NUMBER is the primary key


How to make this primary key ??

Can anyone please help me in this?


--------------------------------------------------------------

Hi ursvmg,

You can define EMP NUMBER as primary key while allocation data self itself

find below for sample KSDS cluster allocation

-------------------------------------------------
//EXMPL1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER /* DEFINE A CLUSTER */ -
(
NAME (KSDS Cluster name) /* CLUSTER NAME */ -
VOLUMES (ACA302) /* CLUSTER IS ON ACA302 */ -
CISZ(4096) /* control interval size */ -
TRACKS(2,1) /* SPECIFYING SIZE */-
RECORD SIZE (80 80) /* this is the record size in KSDS cluster / -
KEYS(6,0) /* FOR DECLARING KEYS */ -
INDEXED) /* CLUSTER IS KSDS */
/*
//

----------------------------------------------------------------------

For loading into KSDS cluster, use a code which gaven in previous mail

raghav
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 1:14 pm    Post subject:
Reply with quote

Hi Murali,


I worked on VSAM, and i tested the card i gave you u just check it out,
it gave me zero error

Please go through manual before sending any mails

Vasanth
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Thu Nov 01, 2007 2:47 pm    Post subject:
Reply with quote

murmohk1 wrote:
Vasanth,

Try your card and let us know the return code.

Raghav,

Thanks for the info. But I suggest you to go thru the manuals for the prerequistes (as said by you).


---------------------------------------------------------------------------------

Hi,

Please find VSAM materials in the following link

http://www.jaymoseley.com/hercules/vstutor/vstutor.htm#AMSrepro1

Regards,
Raghavendra
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 01, 2007 10:25 pm    Post subject:
Reply with quote

Quote:

DEFINE CLUSTER /* DEFINE A CLUSTER */ -
(
NAME (KSDS Cluster name) /* CLUSTER NAME */ -
VOLUMES (ACA302) /* CLUSTER IS ON ACA302 */ -
CISZ(4096) /* control interval size */ -
TRACKS(2,1) /* SPECIFYING SIZE */-
RECORD SIZE (80 80) /* this is the record size in KSDS cluster / -
KEYS(6,0) /* FOR DECLARING KEYS */ -
INDEXED) /* CLUSTER IS KSDS */

Just a couple of points -
1) Why have you chosen a CISZ of 4096. I can half guess at your reason for doing this, but if you would like to elaborate.
2) Defining small VSAM files with a differing primary and second allocation can in some cases causes severe performance problems. For small VSAM files I would recommend that the secondary extent is the same as the primary as the CA size will always be the smaller of the two, which may affect the index structure of the file.

As a matter of course, I very rarely ever allocate a VSAM file with less than one cylinder.

Dare I say, that from the simplicity of the file structure given by the OP that this may be a HOMEWORK question.


Quote:

REPRO-
COPY-
INDATASET("SEQUENTIAL DATASET NAME")- [this data set contains the records to be loaded in to the VSAM data set)
OUTDATASET("VSAM DATASET NAME")-

I think that Murali is questioning the COPY statement. I must admit in over 20 years of IDCAMS I have yet to encounter this statement. Would you be so kind as to point out where in the manual this can be found.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 02, 2007 11:57 am    Post subject:
Reply with quote

expat wrote:


1) Why have you chosen a CISZ of 4096.

As a matter of course, I very rarely ever allocate a VSAM file with less than one cylinder.


Dear expat,

Just to add,

Just i gaven a sample coding sheet for allocation of KSDS Cluster, It need not be 4096 or SIZE is Tracks.

Quote:


----------------------------------------------------------------------------------
REPRO-
COPY-
INDATASET("SEQUENTIAL DATASET NAME")- [this data set contains the records to be loaded in to the VSAM data set)
OUTDATASET("VSAM DATASET NAME")-
-----------------------------------------------------------------------------------

I think that Murali is questioning the COPY statement. I must admit in over 20 years of IDCAMS I have yet to encounter this statement. Would you be so kind as to point out where in the manual this can be found.


About COPY in IDCAMS, I never encounter such command in IDCAMS Utility, As per my experiance; only we can have REPRO command as a control card in IDCAMS Utility

Regards,
Raghavendra
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Nov 02, 2007 12:03 pm    Post subject:
Reply with quote

Expat,

Quote:
I think that Murali is questioning the COPY statement

Atlast some one got MY POINT.

Thanks Raghavendra for your inputs on this.

Vasanth,
Do you have anything to say on this? I belive you implemeted with '0' maxcc before posting the same.

It would great, if you provide some material or link for this syntax. No harm to learn new things. Rite?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Fri Nov 02, 2007 12:54 pm    Post subject: Hi......
Reply with quote

Hi Murali,


Its an writing error that i made, we can use the following syntax to load the VSAM file.

//SYSIN DD *
REPRO
INDATASET (INPUT DATASET SEQ/VSAM CONTAINING DATA)
OUTDATASET (VSAM DATA SET NAME)
/*

Regard's
Vasanth......... icon_smile.gif
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Fri Nov 02, 2007 3:10 pm    Post subject: Dear Murali,
Reply with quote

Quote:
It would great, if you provide some material or link for this syntax. No harm to learn new things. Rite?


here is the link, which covers almost about VSAM.

Link removed

Regards,
Raghavendra
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 02, 2007 4:14 pm    Post subject:
Reply with quote

revel

1) I somehow think that using material other than that supplied by the software provider may not be a smart move.

2) Is the material in the link that you have provided subject to copyright laws ? As a precaution I have removed the link. Please read and read again the various posts by Dick regarding posting links to possibly copyright material.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us