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 

REplace in VsAm file Using sort

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


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Wed Dec 01, 2004 4:25 am    Post subject: REplace in VsAm file Using sort Reply with quote

I have vsam file lrec 4370, VB, KSDS i want change 1,2 position +106 to +407 the veriable dec as s9(2) comp3 can u help me in that

thanks in advance
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: Wed Dec 01, 2004 6:12 am    Post subject: Reply with quote

coolguy,

Quote:

I have vsam file lrec 4370, VB, KSDS i want change 1,2 position +106 to +407 the veriable dec as s9(2) comp3 can u help me in that


Since your input file is a VB file, the actual position of the data is from the 5th byte as the first 4 bytes contains the RDW.

I am assuming that you wanted to hardcode a value of +407 on all the records.You can use the same input vsam file as output vsam file when it is defined with REUSE option.
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=SHR                                   
//SORTOUT  DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=OLD                                   
//SYSIN    DD *                               
  OPTION VSAMIO,RESET,EQUALS                 
  SORT FIELDS=COPY                     
  OUTREC FIELDS=(1,4,        $ RDW
                 X'407C',    $ CONSTANT 407
                 7)
/*                 


If your intention is to change the value of +106 to +407 then you need a change parm. The following JCL will replace all the records which have +106 to +407 .

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=SHR                                   
//SORTOUT  DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=OLD                                   
//SYSIN    DD *                               
  OPTION VSAMIO,RESET,EQUALS                 
  SORT FIELDS=COPY                     
  OUTREC FIELDS=(1,4,       
                 5,2,CHANGE=(2,X'106C',X'407C'),NOMATCH=(5,2),
                 7)
/*                 


Hope this helps...

Cheers

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


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Wed Dec 01, 2004 7:00 am    Post subject: Reply with quote

Thanks for help Kolusu but i am facing Vsam error like

20K BYTES OF EMERGENCY SPACE ALLOCATED
SORTIN : RECFM=V ; LRECL= 4370; CISIZE = 4608
OUTREC RECORD LENGTH = 4374
SORTOUT : RECFM=V ; LRECL= 4370; CISIZE = 4608
5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
0 BYTES RESERVE REQUESTED, 432K BYTES USED
SORTOUT VSAM OPEN ERROR -- A8
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Can u help me

Ravi
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: Wed Dec 01, 2004 9:28 am    Post subject: Reply with quote

Coolguy,

You can use the same input vsam file as output vsam file ONLY when it is defined with REUSE option.

I suspect that your vsam file allocated with reuse=no

So the only option left for you is to code a program to update the vsam file or if you still want to use sort then you need to delete/redefine and reload the cluster.

Hope this helps...

Cheers


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


Joined: 01 Dec 2004
Posts: 82
Topics: 28

PostPosted: Thu Dec 02, 2004 4:00 am    Post subject: Reply with quote

Thanks Kolusu thanks for your help
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