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
 

 

how to insert carriage return through spufi

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: how to insert carriage return through spufi
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

Site Director


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

PostPosted: Sun Nov 23, 2008 1:35 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun Nov 23, 2008 6:32 am    Post subject: Reply to: how to insert carriage return through spufi
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    Post subject:
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

Site Director


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

PostPosted: Sun Nov 23, 2008 7:54 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sun Nov 23, 2008 8:22 am    Post subject: Reply to: how to insert carriage return through spufi
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    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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm


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