IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Give Sql query


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
winchaat

New User


Joined: 23 Mar 2005
Posts: 14

PostPosted: Thu Jan 05, 2006 5:03 pm
Reply with quote

input dataset:
> CLMk Regnum Payment xval
> 1 ab 0 5
> 1 a 23 5
> 1 abc 23 5
> 1 aa 23 5
> 2 as 0 6
> 2 sds 0 6
> 2 sds 12 6
> 2 sd 122 6
>
>
>
> Guys, I need to popluate the xval value only the first
> payment(non zero) in each clmk...
>
>
> CLMK Is Character...
>
>
> here is the expected output.
>
>
>
> CLMk Regnum Payment xval
> 1 ab 0 0
> 1 a 23 5
> 1 abc 23 0
> 1 aa 23 0
> 2 as 0 0
> 2 sds 0 0
> 2 sds 12 6
> 2 sd 122 0
>
>
>
> Could you please give some code for me?
> >
>
> ------->RAG
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Atlanta, (USA)

PostPosted: Fri Jan 06, 2006 1:00 am
Reply with quote

hi winchaat,

i am not able to understand your question. Please could you elaborate it.
thanks.

regards
Back to top
View user's profile Send private message
winchaat

New User


Joined: 23 Mar 2005
Posts: 14

PostPosted: Fri Jan 06, 2006 10:10 am
Reply with quote

all,

pls refer attached text file.



----->RAG
Back to top
View user's profile Send private message
winchaat

New User


Joined: 23 Mar 2005
Posts: 14

PostPosted: Fri Jan 06, 2006 10:12 am
Reply with quote

pls save the above file and open
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Jan 06, 2006 11:41 am
Reply with quote

winchaat,

I tried hard to understand your requirement...Do you mean below...?

There can be more than one row for CLMK field. And you want to update each row GROUP BY CLMK & SET XVAL=0.

If this is what you were looking for then why in your expected output second row contains XVAL=5.
Quote:
> 1 a 23 5


Regards,

Priyesh.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top