I am reading a flat file on the mainframe using SAS spawner. One of the input reading field is
@0198 DESCRIPT $CHAR45.
When I read it, one of the following filed value on the file(input file) is
toifcitrixc14p. Endpoint Unreachble
After I read, I see the value in the SAS dataset is
toifcitrixc14p'box' Endpoint Unreachble
Note that , here I write box instead of box character because I am not able write a box char.
When I put the following option
infile info lrecl=700 pad ignoredoseof.
I see the following error message.
3 infile info lrecl=700 pad ignoredoseof;
ERROR 23-2: Invalid option name IGNOREDOSEOF.
Can any one help me out, how to ignore this box char when I read the file. because when I write back to text file, it shift all fields after the filed DESCRIPT.
Thank so much Duke.
I know I can use Compress function to suppress the box char, if I find the hex value of the box char. But is it possible to find any options to ignore globally any special char like this when I read any input that have special char because I don't know if other variable have the same issue.
If I understand that right then you want to have SAS to solve an issue which you have with your data.
It sounds to me as if you will need some data cleansing after reading the data. You could use translate for that - translating a defined set of special characters to blanks.
More general would be to use Perl Regular Expressions (have a look at PRXCHANGE), "\s" matches all whitespace characters - that is what most probably then shows up as a 'box'. So just translate all whitespace characters to blanks.
Something close to the following should do the job:
PID=PRXPARSE ('s/\s/ /io');
infile .... truncover;
input @1 var1 @3var2;
Your file and all the processing happens on the Mainframe (EBCDIC) but you see the result in an 'ASCII environment (EG?). It could be (less likely) that there is some problem with the translation (trantab) between this two environments.
To see the special character in your Mainframe file use your Mainframe editor and type on the command line "Hex on"; a tab (the most likely problem char) would have the Hex value 05.
P.S: forget about 'pad', just use 'truncover'
Message was edited by: Patrick