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
 

 

Want to update 5th record of peritcular column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Sun Aug 13, 2006 4:05 pm    Post subject: Want to update 5th record of peritcular column
Reply with quote

hi ALL

If there is sequential file n it has 10 records n i want to update 5th record of peritcular column how to upadate thru cobol prg.

PLZ help me out

thx in advance
jamshir
Back to top
View user's profile Send private message

IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Sun Aug 13, 2006 6:02 pm    Post subject: Re: Want to update 5th record of peritcular column
Reply with quote

Give examples of inputs and expected outputs then we can help you
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Aug 14, 2006 12:35 am    Post subject: Re: Want to update 5th record of peritcular column
Reply with quote

Pseudo code

Code:

    OPEN OI FILE   
    READ FILE
    MOVE +1        TO WS-REC-COUNT
    PERFORM
      UNTIL FILE-EOF
        IF WS-REC-COUNT = 5
        THEN
            UPDATE RECORD
        END-IF
        REWRITE FILE-REC
        READ FILE
        ADD +1     TO WS-REC-COUNT
    END-PERFORM
    CLOSE FILE


Dave
Back to top
View user's profile Send private message
jamshirqureshi

New User


Joined: 13 Aug 2006
Posts: 20
Location: mumbai

PostPosted: Wed Aug 16, 2006 1:51 pm    Post subject:
Reply with quote

thx dave
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Wed Aug 16, 2006 5:27 pm    Post subject:
Reply with quote

Hello david can you please explain the need of rewrite in the above code
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm


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