Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Give Sql query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Give Sql query
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: Kentucky, USA

PostPosted: Fri Jan 06, 2006 1:00 am    Post subject: Re: Give Sql query
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    Post subject:
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Jan 06, 2006 11:41 am    Post subject: Re: Give Sql query
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    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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us