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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing double quote marks 1

Status
Not open for further replies.

pingponger

Programmer
Jan 23, 2005
4
US
I am trying to remove double quotes from an input file's fields. I have also tried unsuccessfully to delete the header line.

Here is my code:

data all_tbls_temp ;
infile rsltin01 DLM=',' DSD TRUNCOVER;

input

@002 selauth $01.
@006 updauth $01.
@010 aix_in $08.
@021 tbl :$35.
;
aix = compress(aix_in,'"');
end;
run;

Here is the log error msg:

14 data all_tbls_temp ;
15 infile rsltin01 DLM=',' DSD TRUNCOVER;
16
17 input
18
19 @002 selauth $01.
20 @006 updauth $01.
21 @010 aix_in $08.
22 @021 tbl :$35.
23 ;
24 aix = compress(aix_in,'"');
25 end;^M ___^M ___^M ___
161^M 161^M 161
ERROR 161-185: No matching DO/SELECT statement.^MERROR 161-185: No matching DO/S
ELECT statement.^MERROR 161-185: No matching DO/SELECT statement.

Also, could someone help to delete the header record - for instance the aix_in field VALUE in the header record is "AIX".
 
OK, first off, the end is obviously not meant to be there. In SAS, END completes a DO segment, you have no "do" in your datastep.

Second, to skip the header row, use the option "firstobs=2".

Third, if the file is a comma delimited file, which you infile statement says it is, you shouldn't be using column pointers to say where to pick up the data from:-
Code:
data all_tbls_temp ;
   infile rsltin01 DLM=',' DSD TRUNCOVER firstobs=2;

   input selauth $01.
         updauth $01.
         aix_in $08.
         tbl :$35.
         ;
   * You may not need this compress statement:- *;
   aix = compress(aix_in,'"');

run;
I don't often have problems with quotes being read in, so try running this without the compress statement and see if it works first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top