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 

How to modify data in one record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Tue Jun 27, 2006 7:03 am    Post subject: How to modify data in one record Reply with quote

Hi,

I have a file which is having 300,000 records. I need to update one record in that. If i try to open that file in edit mode its automaticaly going to browse mode. Its same even if I try in File-Aid too. Pls. let me know how can I do that.

Cheers!!!
Nadh
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Jun 27, 2006 8:24 am    Post subject: Reply with quote

nadh,

Why not run file-aid in batch mode to perform the update.

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


Joined: 28 Jun 2006
Posts: 1
Topics: 0

PostPosted: Sun Jul 02, 2006 4:19 am    Post subject: Reply with quote

You can open the file using file aid and use 'selection criteria' as temporary. In the next panel, choose '1'. specify the selection criteria there.
ie you can skip 299999 records and edit the required record.
Back to top
View user's profile Send private message
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Mon Jul 03, 2006 8:03 am    Post subject: Reply with quote

Nadh,

Say you have to modify the 900th record. Then you can can do like this.

Split your file into 3 files, the first having 899 records.
The second having only the 900th record.
The third file having the remaining records.

Modify the second file with the changes you want and then merge these together.
The above split can be achived using ICEMAN (Hope u have DFSORT installed in your installation)

Quote:


//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT FILE,DISP=OLD
//ONE DD DSN=OUTPUT-FILE-ONE,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//TWO DD DSN=OUTPUT-FILE-TWO,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//THREE DD DSN=OUTPUT-FILE-THREE,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=ONE,ENDREC=899
OUTFIL FNAMES=TWO,STARTREC=900,ENDREC=900
OUTFIL FNAMES=THREE,STARTREC=901




After this just do a simple sort to merge these files into one output file.

Deepesh
Back to top
View user's profile Send private message AIM Address
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Jul 03, 2006 8:20 am    Post subject: Reply with quote

deepeshk79,

You don't need to split and merge for modifying the record. All of this can done in one simple step

for the same example you quoted here is a one step solution. If the record no is 900 then we change the contents at pos 5 to 'change'

Code:

//STEP0100  EXEC PGM=SORT               
//SYSOUT    DD SYSOUT=*                 
//SORTIN    DD *                       
A                                       
B                                       
C                                       
D                                       
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD    *                     
  SORT FIELDS=COPY                     
  INREC FIELDS=(1,80,SEQNUM,8,ZD)       
  OUTREC IFTHEN=(WHEN=(81,8,ZD,EQ,900),   
         OVERLAY=(5:C'CHANGE'))         
  OUTFIL OUTREC=(1,80)                 
/*                                     


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
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Tue Jul 04, 2006 4:16 am    Post subject: Reply with quote

ThanQ Kolusu,

It worked.

Cheers!!!
Nadh
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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