BTEQ conversion from mainframe to shell script

Tools & Utilities
Highlighted
Enthusiast

BTEQ conversion from mainframe to shell script

I'm trying to convert our mainframe jobs to Linux shell scripts. I create an output file that's supposed to drop inactive users but two leading null characters are being added to the output that makes the output file not run. The error I get is:

*** Error: Instruction contains one or more NULL characters.

*** Input text that preceded the invalid character:

I've played with a lot of the formatting BTEQ settings but nothing's removing these two characters. Here's what I've got:

.set errorout stderr
.set echoreq on
.show controls
.set separator 0
.set format off
.set recordmode off

.EXPORT DATA FILE=/var/opt/teradata/user/Work/userworkremove.$tdenv.$LOG_DATETM;
SELECT 'DROP USER ' || TRIM(UserNM) || ';' (char(30)) (title '') FROM ClearList_PurgeUSR;
.export reset

 

Here's an example of one line of output:

  DROP USER TEST;

I don't understand where these two null characters are coming from or how to get rid of them. Any help would be appreciated!

 


Accepted Solutions
Teradata Employee

Re: BTEQ conversion from mainframe to shell script

The two character are because you are creating a load file format.

 

Use REPORT to create a text file

 

.EXPORT REPORT FILE=xxxx.txt;

 

dave

1 ACCEPTED SOLUTION
2 REPLIES 2
Teradata Employee

Re: BTEQ conversion from mainframe to shell script

The two character are because you are creating a load file format.

 

Use REPORT to create a text file

 

.EXPORT REPORT FILE=xxxx.txt;

 

dave

Enthusiast

Re: BTEQ conversion from mainframe to shell script

I should've posted my issue sooner! Thanks so much Dave, this worked! You have no idea how many different settings I've tried.