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
 

 

Justify to pick up all records which start with SL

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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Sep 11, 2008 11:22 pm    Post subject: Justify to pick up all records which start with SL
Reply with quote

Hi,

In the database
I have got values as
1. 'bbbbbSLTT'
2. 'bbSLATbbb'

where b is the blank.

I want to pick up all records which start with SL. How do I handle that ?
Please note that it we dont know from where the SL starts.
Please advise.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 11, 2008 11:36 pm    Post subject:
Reply with quote

If the value starts with a blank then it doesn't start with "SL".
Code:
You could use WHERE POSSTR(FIELD, ' SL') <> 0 to find BlankSL or WHERE posstr(field, 'SL') <> 0 just to find a row that contains SL.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Thu Sep 11, 2008 11:44 pm    Post subject: Reply to: Justify
Reply with quote

I used LTRIM to get that done.
Thanks.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 11:39 am    Post subject: Reply to: Justify to pick up all records which start with SL
Reply with quote

Quote:
I used LTRIM to get that done.


Good. Could you please post the complete SQL that you had used? This would benefit everyone.
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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