IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Ways to load data in to a VSAM file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Oct 31, 2007 12:48 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Oct 31, 2007 1:00 pm
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
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: 275
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 12:31 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Nov 01, 2007 12:42 pm
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: 275
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 12:55 pm
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
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: 275
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 1:00 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Nov 01, 2007 1:04 pm
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
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: 275
Location: Bang,iflex

PostPosted: Thu Nov 01, 2007 1:14 pm
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
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

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: 8796
Location: Welsh Wales

PostPosted: Thu Nov 01, 2007 10:25 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Nov 02, 2007 12:03 pm
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: 275
Location: Bang,iflex

PostPosted: Fri Nov 02, 2007 12:54 pm
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
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: 8796
Location: Welsh Wales

PostPosted: Fri Nov 02, 2007 4:14 pm
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
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Nov 02, 2007 8:20 pm
Reply with quote

icon_redface.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts db2 vs static data COBOL Programming 1
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Pull data using date difference betwe... DB2 6
No new posts fast data scrambling PL/I & Assembler 10
Search our Forums:

Back to Top