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
 
Need to compare part of the string with the another string..

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

New User


Joined: 19 Apr 2006
Posts: 63
Location: Chennai

PostPosted: Tue Aug 17, 2010 11:07 am    Post subject: Need to compare part of the string with the another string..
Reply with quote

Hi,

i need to compare part of the string with another string.

Select *
From <table name>
where a_b_c(12:6) = x_y_z;
,,,,

Length of the a_b_c is 17 bytes, I need to compare with last 6 byes. Please let me know how to represent a_b_c(12:6).

Thanks in Advance.

Regards
Vijay
Back to top
View user's profile Send private message

ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Tue Aug 17, 2010 11:23 am    Post subject:
Reply with quote

Hi Vijay,

You can use SUBSTR for this.

Code:
SELECT *
FROM <TABLE>
WHERE
SUBSTR(A_B_C,12,6) = X_Y_Z;


Thanks,
Back to top
View user's profile Send private message
vijayakumar.yellala

New User


Joined: 19 Apr 2006
Posts: 63
Location: Chennai

PostPosted: Tue Aug 17, 2010 11:25 am    Post subject:
Reply with quote

Thanks for response..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 17, 2010 7:35 pm    Post subject:
Reply with quote

Hello,

Just keep in mind that this kind of query has the potential to dim all of the lights in the computer room. . .

If this is some one-time requirement or something that only runs sedom in batch, the impact may not be much, but if the table is high-volume and this query is often needed in online processing - there be monsters. . .

Suggest this process be run against full-volume data to make sure it runs acceptably with minimum impact to the rest of the system.

If the table has only 100 rows, it may not be important if the table contains 100 million rows, this will be an entirely different matter.
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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