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

Justify to pick up all records which start with SL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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: 1287
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 11:39 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top