Control characters in Unix file from BTEQ script.Moreover,control characters are common in the file
I have the below data in the table KVB
.export data file=sha.txt
.set quiet on
.set width 1500
.set seperator '|'
select ename,empno,gender from kvb;
My output looks like the below one with control characters and empno is missing
you're exporting in binary format, the control chars are 2-byte SMALLINTs for the rcord length and the varchar length, try EXPORT REPORT instead.
Just use ".export file=sha.txt" instead of ".export data file=sha.txt".
See bteq manual on more details of the syntax being used in your script.
Thanks for your inputs.I got the below output.
EMPNO ENAME GENDER
----------- -------------------- ------
2 BHARATH M
1 VENKAT M
5 ? M
3 RADHA F
can't i get something like the below one.
you have to TRIM/CONCAT on your own:
select trim(ename) || '|' || trim(empno) || '|' || gender (title '') from kvb;
And don't forget COALESCE when there are NULLable columns :-)