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
 

 

SQL - WHERE clause with reference modification and "_&q

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

New User


Joined: 04 May 2007
Posts: 20
Location: INDIA

PostPosted: Tue Nov 09, 2010 6:12 am    Post subject: SQL - WHERE clause with reference modification and "_&q
Reply with quote

Hi,
I have a column of size 8 bytes. I want to extract all the records with the 4th byte having specific values. For eg.

Table-1

Col-1
------
ABC1ABC1
AAA2AAA2
BEF1BCD1
ABED1YMK2

from the above sample table, i want to extract all the records having the value "2" in the 4th position of that column-1.
I can think of "_" but not sure how to use against a specific position, like 4th byte only.
Can some one please help me with the WHERE clause for this getting the above desired result?
Thanks in advance
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


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

PostPosted: Tue Nov 09, 2010 6:16 am    Post subject:
Reply with quote

Suggest you read about substr in the SQL reference.
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 Nov 09, 2010 9:28 am    Post subject:
Reply with quote

Hello,

And expect poor performance. . .
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Tue Nov 09, 2010 9:34 am    Post subject:
Reply with quote

If performance is your concern then take unload extract of table and simply sequentially read the file and look for the desired byte location to filter the records.
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 Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts "DFSRRC00 vs IKJEFT01" for ... arunsoods All Other Mainframe Topics 5 Fri Aug 12, 2016 9:54 pm


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