MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can we create VSAM KSDS file using SORT utility

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
logesht
Beginner


Joined: 18 Apr 2011
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Tue Apr 26, 2011 2:06 am    Post subject: Can we create VSAM KSDS file using SORT utility Reply with quote

Is it possible to create a VSAM KSDS file using SORT utility.If so pls let me know
Back to top
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Tue Apr 26, 2011 6:17 am    Post subject: Reply with quote

It's not possible, AFAIK.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Apr 26, 2011 10:28 am    Post subject: Reply with quote

to create a VSAM you need IDCAMS Define.

sort can load a VSAM file, probably faster than IDCAMS Repro
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 26, 2011 10:40 am    Post subject: Reply with quote

logesht,

The following DFSORT JCL will give you the desired results. The output is a KSDS file which has the key at offset 0 for a length of 10 bytes and an lrecl of 216. It also adds 10 records to the KSDS cluster with the seqnum as key. You can change/add any additional parameters you want.

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                 
A                                               
//SORTOUT  DD DSN=Your Output VSAM file,
//            DISP=(NEW,CATLG,DELETE),           
//            SPACE=(CYL,(1,1),RLSE),           
//            RECORG=KS,LRECL=216,KEYLEN=10     
//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  OUTFIL REPEAT=10,BUILD=(SEQNUM,10,ZD,216:X)   
//*


Run this step to check the attributes of the vsam file created above
Code:

//STEP0150 EXEC PGM=IDCAMS               
//SYSPRINT DD SYSOUT=*                   
//SYSIN    DD *                         
     LISTCAT ENT('Your Output VSAM file') ALL   
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Apr 26, 2011 4:08 pm    Post subject: Reply with quote

I knew that if i commented in this post, i would end up eating my lunch.

Kolusu,

I was going to ask how long have we been able to define a vsam with dcb parms,
but, maybe forever is the answer?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Apr 26, 2011 5:51 pm    Post subject: Reply with quote

dbzTHEdinosauer wrote:
Kolusu,

I was going to ask how long have we been able to define a vsam with dcb parms, but, maybe forever is the answer?


dbzTHEdinosauer,

AFAIK VSAM datasets can defined in JCL from OS/390 days itself. Using JCL for VSAM is documented in detail in "DFSMS Using Data Sets". May be that is the reason it didn't get much attention, even though all the parameters that can be used with VSAM datasets are explained individually in JCL reference manual.

Here is the link for using JCL for VSAM from the book DFSMS Using Data Sets.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D490/2.13
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Wed Apr 27, 2011 5:30 am    Post subject: Reply with quote

Thanks Kolusu. IDCAMS had been my choice since so long. Did not think about RECORG=KS.

But this sounds if this is to do with DCB parameters - may be, as original question asks for, not only SORT any suitable program will do it then. e.g.: IEFBR14 -- of course, it would be any empty VSAM, though.

Thanks again for the links.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
logesht
Beginner


Joined: 18 Apr 2011
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Wed Apr 27, 2011 10:14 am    Post subject: Reply with quote

Thank you very much!
Back to top
View user's profile Send private message
logesht
Beginner


Joined: 18 Apr 2011
Posts: 3
Topics: 1
Location: Chennai

PostPosted: Thu Apr 28, 2011 1:07 am    Post subject: Reply with quote

Hi,
Can you pls tell me how we can define the offset here?

Thanks,
Logesh
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Apr 28, 2011 6:18 am    Post subject: Reply with quote

in the link that Kolusu gave you,
that you decided not to read,
look for:
2.13.2 Creating VSAM Data Sets with JCL,
and
keyoff
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group