pipe delimited output from dssh

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

pipe delimited output from dssh

Post by mystuff »

Hi there,

I am wanted to obtain a pipe delimited output while reading from hashed file

Code: Select all

dssh << EOF > $filename
select * from hash;
>EOF
looks likes this file generates a tab-delimited output. I wanted a pipe-delimited output. I can't replace tabs with pipes, as the data might contain tabs.

Is there anything similar to as

Code: Select all

set colsep '|'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage/SQL does not generated delimited output at all - it generates fixed width output.

To get pipe-delimited, the only way is to generate the pipe characters yourself.

Code: Select all

SELECT col1, '|', col2, '|', col3 FROM hashedfile;
Even then the data columns will be fixed width as specified in the file dictionary, so you may prefer to trim them (if the data type is Char or VarChar, or CAST before applying trim function). In the worst case:

Code: Select all

SELECT TRIM(CAST(col1 AS VARCHAR)),'|'.TRIM(CAST(col2 AS VARCHAR)) FROM hashedfile;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply