MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Include a Carriage Return (x'0D') in a result set

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
agredell
Beginner


Joined: 04 May 2006
Posts: 27
Topics: 6

PostPosted: Wed Jan 03, 2007 10:39 am    Post subject: Include a Carriage Return (x'0D') in a result set Reply with quote

I've built a query that has been working fine, but the file is being transferred by SFTP (used to be a standard FTP), and the required CR/LF line termination that terminated each output line in the FTP has become just a LF on the SFTP (on the mainframe, original file is OS/390, transferred to Linux, then SFTP to a vendor); if I can't find an option or parameter that puts it out there, I was considering the concatenation of a CR to each record, on the assumption that it will still be followed with a LF character. I tried using the HEX('0D') function, but that appends the literal 'F0C4' to each line.

Thanks, in advance, for any help...
_________________
Alan Gredell
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jan 03, 2007 10:54 am    Post subject: Reply with quote

agredell,

You don't need HEX function as you are already providing the string in hex format. You just need a Char function with hex string. Try this . add the following at the end of your query and every line will have the hex value of '0D'
Code:

SELECT col1
      ,col2
       ....
      ,CHAR(X'0D')   
  FROM table
 ;


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
agredell
Beginner


Joined: 04 May 2006
Posts: 27
Topics: 6

PostPosted: Wed Jan 03, 2007 11:11 am    Post subject: Reply with quote

Thanks, Kolusu; my nitty gritty work with DB2 has been limited lately, I knew this answer, but couldn't pull it from offline storage!! My buffers had been flushed!! Your help, as always, is appreciated! Embarassed Very Happy
_________________
Alan Gredell
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group