1

Suppose there is string = 'Hello how are you? Are you there?'

I want the string to be splitted into 2 lines, basically want to put a new line character in between, so that the export file (from bteq) captures it.

o/p in export file expected:

Hello
how are you? Are you there?

None of the below solutions could generate the expected output.

.EXPORT FILE=xyz.txt;

sel 'Hello \n how are you? Are you there?' sel 'hello Chr(10) how are you? Are you there?'

Any suggestions? Can anyone help with a way to print a newline into the export file?

pc52938
  • 11
  • 2
  • Default behavior for REPORT format export is to convert control characters (including newlines) to spaces. Current versions of BTEQ support `.SET TRANSLATECTRLSTOSPACES OFF` command to avoid this translation. – Fred Feb 11 '21 at 19:07
  • 1
    @Fred - does that work for newline, tab, etc characters? BTW, trying to use a tool like BTEQ to create a formatted document seems like a pretty bad idea to me. – Andrew Feb 11 '21 at 22:20
  • Yes, it just sends all character data to the output "as is". BTEQ can be used to format simple tabular reports, and replacing control characters with spaces helps keep the column, row, page alignment in that case. – Fred Feb 12 '21 at 00:31
  • .set translatectrlstospaces is not working. Sel 'hello\n how are you' its output exported as 'hello\n how are you'. No newline is placed after hello... – pc52938 Feb 20 '21 at 03:38

0 Answers0