Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to update a particular record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Wed Dec 07, 2005 4:03 pm    Post subject: How to update a particular record
Reply with quote

Hi,

I have an input file with some set of records like,

A/C no CUSTNAME ADDRESS1 ADDRESS2
--------- ------------- ------------- -------------
12937487 GUPTA AAAAAAAA BBBBBBBB
83737366 JOHN CCCCCCC DDDDDDD
23345556 JUDE EEEEEEEEE GGGGGGG

Here i want to update the third record JUDE. Kindly Provide me with example of code for this.
Back to top
View user's profile Send private message

Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Thu Dec 08, 2005 11:00 am    Post subject: Re: How to update a particular record
Reply with quote

I hav one more clarification. In yr code

"EXECIO 1 DISKRU IN 3"

You have given updated line number as 3. Suppose 10000 records, in that case I dont know abt the line number of that record to be updated. How to specify the line number in such situation.
Back to top
View user's profile Send private message
Ravi gaur

New User


Joined: 12 Jul 2005
Posts: 38

PostPosted: Thu Dec 08, 2005 5:15 pm    Post subject: Re: How to update a particular record
Reply with quote

use this code :- but remember i m parsing input data using position Please change the position(1,9,10 etc etc) if you get any problem please let me know the position for the input data.
Code:

 /* REXX  */                                               
 "ALLOC DA('SF0619.TEST3') FILE(INP) SHR"                 
 "ALLOC DA('SF0619.TEST5') FILE(OUT) SHR"                 
 "EXECIO * DISKR INP (STEM INP. FINIS"                     
 J=0                                                       
 DO I=1 TO INP.0                                           
 PARSE VAR INP.I 1 VAR1 9 10 VAR2  18 19 VAR3 35 .         
 J=J+1                                                     
     IF LEFT(VAR2,4)='JUDE' THEN                           
        DO                                                 
          VAR2=RAVI                                       
          VAR.J=' 'VAR1||' 'VAR2||' 'VAR3                 
        END                                               
     ELSE                                                 
          VAR.J=' 'VAR1||' 'VAR2||' 'VAR3                 
 END                                                       
 "EXECIO * DISKW OUT (STEM VAR."                           
 "FREE F(INP OUT)"                                         
DROP VAR.
Back to top
View user's profile Send private message
Prabha
Warnings : 2

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Fri Dec 09, 2005 11:32 am    Post subject: Re: How to update a particular record
Reply with quote

Your code is doing updated fields in another output file. But i need to update in same file itself.

Thanks a lot for yr code.
Back to top
View user's profile Send private message
MichaelKBS

New User


Joined: 10 Jan 2006
Posts: 24
Location: Germany

PostPosted: Tue Jan 10, 2006 6:27 pm    Post subject:
Reply with quote

Try the following method:


do forever

"execio" 1 "diskru filename"

/* ask for End-Of-File */
if rc = 2 then do
leave
end

parse pull record
field1 = subword(record,1,1)
if field1 = 'AAAAAAA' then do
field1 = 'BBBBBBB'
record = field1!!subword(record,2)
queue record
"execio 1 diskw filename"
end

end


Regards,

Michael
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us