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

how to insert carriage return through spufi


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

New User


Joined: 01 Mar 2005
Posts: 20

PostPosted: Sat Nov 22, 2008 11:07 pm
Reply with quote

HI ,

I've a requirement where I have to include carriage return (character) at the end of each sentence and that whole string needs to be inserted in a column of varchar(3900). How to achive this through spufi?
The string I want to insert,for example

This is John.<carriage return>How are you doing?<carriage return>Call me if possible.<carriage return>

FYI, The hexa decimal equivalent of carriage return ---> 0D

Any help is appreciated

Thanks in advance
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: Sun Nov 23, 2008 1:35 am
Reply with quote

Hello,

Just include the character as a literal:

Code:
select col1, x'0d', 
       col2, x'0d', 
       col3           
  from the_table
 where . . . .
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Sun Nov 23, 2008 6:24 am
Reply with quote

In order to due it on an insert you would have concantenate the data and a x'0d' or specify all the data in hex and just add x'0d' where appropriate.
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: Sun Nov 23, 2008 6:32 am
Reply with quote

Thanks Craig,

My bad - i didn't read the request properly. . . icon_redface.gif

I only saw the "spufi" and the c/r. . .


d
Back to top
View user's profile Send private message
i_suman

New User


Joined: 01 Mar 2005
Posts: 20

PostPosted: Sun Nov 23, 2008 6:55 am
Reply with quote

Craq,

I tried as you said even before posting this question. But I'm unsuccessful. I tried something like this where it is throwing either -103 or -110 (tried giving x'0d' in several ways like X"0D" etc). I am not sure where I am missing the syntax. Complete query with syntax,which is workable is much appreciated.

INSERT INTO devl.table1
(name,
date,
description
)
values
('john',
'1998-01-01',
'This is John.x'0D'How are you doing?x'0D''
)

Thanks for your replies.
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: Sun Nov 23, 2008 7:54 am
Reply with quote

Hello,

Try this:
'This is John.' || x'0D' || 'How are you doing?' || x'0D''

My system is offline so i'm not able to test just now. If the vertical bars do not work, try CONCAT instead.
Back to top
View user's profile Send private message
i_suman

New User


Joined: 01 Mar 2005
Posts: 20

PostPosted: Sun Nov 23, 2008 8:16 am
Reply with quote

Hi D.sch,

It seems its working. I tried it on db2 udb (on my computer). However I have to try it through spufi when I have system available. I will update you.

Thanks a lot for your time and valuble answers.
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: Sun Nov 23, 2008 8:22 am
Reply with quote

You're welcome - good luck icon_smile.gif

Sorry about the early misdirection. . .

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 DELETE SPUFI DB2 1
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
Search our Forums:

Back to Top