Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXPORT DATA FILE

Status
Not open for further replies.

suvamad

Technical User
Nov 20, 2002
2
US
I am trying to export the data file using the bteq. I see everything fine except I am getting some special charecters in front of the first field. How to avoid these special charecters.

Thanks
 
This is the usual record layout for .EXPORT DATA:
- two bytes (word) record length
- data
- end of record marker

The only way to get rid of the record length is to use REPORT FORMAT, but then it's in text format ;-(

Dieter
 
Dnoeth,

Thanks for your answer.
So you mean to say, I should use
.EXPORT REPORT FILE
instead of
.EXPORT DATA FILE

If that is the case, my record in the output file will get truncated after 254 bytes.

Thanks



 
You could keep using .export data if you get rid of the first two bytes in that format.

Get rid of those bytes using the cut command in unix, like this:

#################
# start unixscript
#################

mkfifo /tmp/mypipe.pipe
cat /tmp/mypipe.pipe|cut -b '5-999'|dd of=myfile.txt obs=32k &

bteq << EOF

.logon user,passwd;
.export data file=/tmp/mypipe.pipe,close;

select *
from table;

.export reset
.quit 0

EOF
#################
# end unixscript
#################
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top