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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm


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