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 

Changing the key of KSDS programmatically in COBOL

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


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Sun Dec 10, 2006 9:43 am    Post subject: Changing the key of KSDS programmatically in COBOL Reply with quote

HOw can we change the already defined key of KSDS vsam file programmatically in COBOL program ?
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


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

PostPosted: Sun Dec 10, 2006 12:55 pm    Post subject: Reply with quote

If there is no physical change to the record structure:
  • repro to a qsam
  • delete the vsam
  • define the vsam with the new key
  • repro the qsam to the new vsam
  • make appropriate changes in all programs that reference the vsam record or perform I/O on the file


If there is a physical change to the record structure:
  • if the file is very large
    • write a conversion program
      • reads old structure
      • reformats record
      • writes new structure
    • define new vsam file
    • run conversion pgm
  • if the file is small
    • repro old to qsam
    • write cobol to convert old qsam to new qsam
    • sort new qsam
    • define new vsam
    • repro new qsam to new vsam

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


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

PostPosted: Sun Dec 10, 2006 1:00 pm    Post subject: Reply with quote

The of course only process the new vsam structure with the updated cobol programs.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
jyoung
Beginner


Joined: 10 Nov 2005
Posts: 36
Topics: 2
Location: Flint, MI

PostPosted: Mon Dec 11, 2006 8:07 am    Post subject: Reply with quote

Could you create an alternate index and then access it that way?
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 -> Application Programming 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