Groups | Search | Server Info | Login | Register


Groups > comp.soft-sys.sas > #856

How do I get rid of extra blanks in output txt file?

From clipartfan <rmechk@gmail.com>
Newsgroups comp.soft-sys.sas
Subject How do I get rid of extra blanks in output txt file?
Date 2011-06-02 07:41 -0700
Organization http://groups.google.com
Message-ID <64b1760b-2747-44e3-be5a-d6793f0cf0a3@cc2g2000vbb.googlegroups.com> (permalink)

Show all headers | View raw


I am creating a txt output file that will be read into another pgm as
sql.
My sample output looks like:

delete from nessdba.NESS_OFAC_MERGE;
INSERT INTO TEMP.OFAC_MERGE ( MERGE_ID, BIU_ID, WC_ID, OFAC_ID, GL_ID,
MATCHED_AGAINST )  VALUES (1111 ,'11111 ','97777 ','004444
','SPVS0000001 ','COMPANY NAME ');
.
 ..
  ....
commit;

Problem is that the extra spaces before the tick marks are causing an
error. How can I get rid of them? My pgm code is below.


data _null_;
file 'C:\Users\da34936\Desktop\temp.txt';
if _n_ = 1 then do;
put @001 'delete from temp.OFAC_MERGE;';
end;
run;

data _null_;
set db_output END=EOF;
file 'C:\Users\da34936\Desktop\temp.txt' mod;
put @001 "INSERT INTO TEMP.OFAC_MERGE ( MERGE_ID, BIU_ID, WC_ID,
OFAC_ID, GL_ID, MATCHED_AGAINST )  VALUES
("
MERGE_ID
",'"
biu_id
"','"
wc_id
"','"
ofac_id
"','"
gl_id
"','"
matched_name
"'"
");"
;

if eof then do;
put @001 "commit;";
end;
return;

run;

Back to comp.soft-sys.sas | Previous | NextNext in thread | Find similar


Thread

How do I get rid of extra blanks in output txt file? clipartfan <rmechk@gmail.com> - 2011-06-02 07:41 -0700
  Re: How do I get rid of extra blanks in output txt file? Ya <huang8012@gmail.com> - 2011-06-02 08:17 -0700
    Re: How do I get rid of extra blanks in output txt file? clipartfan <rmechk@gmail.com> - 2011-06-02 11:39 -0700
      Re: How do I get rid of extra blanks in output txt file? Ya <huang8012@gmail.com> - 2011-06-02 13:38 -0700

csiph-web