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: 158
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Reasonable way of checking wildcards ... sergeyken CLIST & REXX 5 Wed Sep 07, 2016 8:43 pm


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