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

Reqarding a query executed using IKJEFT01


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prasannahcp

New User


Joined: 16 May 2005
Posts: 16
Location: Bangalore

PostPosted: Wed Dec 17, 2008 3:10 pm
Reply with quote

Hi,
I have a query executed using IKJEFT01 for concatenation of fields
county COUNTY || '|' || STATE || '|' ||PARCEL
from TB_PARCEL;

COUNTY is CHAR(2) NOT NULL
STATE is CHAR(2) NOT NULL
PARCEL is CHAR(20) NOT NULL

I am getting the result as below

..011|AA|11111111
..022|BB|22222222

extra two characters are coming in the first 2 bytes. I am expecting the output without those first two bytes. Can anybody help?
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Dec 17, 2008 5:18 pm
Reply with quote

Hi,

Did you check how the data is in the table.
Try using substring function.

Sushanth
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Wed Dec 17, 2008 6:07 pm
Reply with quote

When you concatenate data with literals the result is a variable length string, you would have to cast that as a fixed length string or use the substr function to remove the two byte length.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Dec 18, 2008 12:20 am
Reply with quote

Please refrain from posting the same question under 2 different topics.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Dec 18, 2008 12:35 am
Reply with quote

The same topic mentioning IDCAMS has been deleted. . .

d
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top