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
 

 

Checking the Updated value in a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Fri Dec 04, 2009 12:53 pm    Post subject: Checking the Updated value in a table
Reply with quote

Hi,
i have a requirement to update a particular valuein a tbale.

First i have retrieved the values from the table

Code:

      SELECT  A_1,B_1,B_2,B_3
         
        INTO
             :A-1,:B-1 :NULL,:B-2 :NULL1,:B-3 :NULL2
 
    FROM TABLE A
    WHERE A= :A
               B = :B


where the b_1 b_2 b_3 are null defined

base on the condition

Code:


   IF NULL <0 and
       NULL1 < 0 and
        NULL2 < 0
      MOVE CURRENT DATE  TO   hold-var
   ELSE
      CONTINUE
   END-IF.
       



earlier the value picked up from the A_1 has default date 0001-01-01

now i have to update the value

Code:

    UPDATE TABLE A
          SET A_1 = :HOLD-VAR
             
          WHERE B_1 = :B-1
       
     


NOW im evaluating the hosst variable
A-1
it still has the value 0001-01-01 while i have updated just before this

can u help me out like the host variable does hold the value of previous fetch or the updated value because here after updation of A_1 im not fetching the value from the table.
Back to top
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Dec 04, 2009 1:17 pm    Post subject:
Reply with quote

It obviously holds the value from previous fetch (or any other value if it is modified in the program).
Cobol and DB2 are two different things and only a query can connect them both.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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