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
 

 

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 compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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