Date: Fri, 10 May 2002 08:54:28 +0200
Reply-To: Andreas Grüninger <andreas.grueninger@LFL.BWL.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Andreas Grüninger <andreas.grueninger@LFL.BWL.DE>
Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany)
Subject: Re: Put and carraige-returns
Use the VARYINGx. format for output too.
* do some manipulation with your variable line and ask afterwards for the
length of line ;
ln = LENGTH( line );
PUT line VARYING1024. ln;
"Goldman, Brad AT-Atlanta" <Brad.Goldman@AUTOTRADER.COM> schrieb im
> Hi all. I am working on a program which will update some HTML forms via
> SAS. Here is a stripped down version of the code:
> data _null_;
> infile "/links/mandash/dealer_services/wartest.htm" length=ln;
> file "~/temp";
> input @;
> input line $varying1024. ln;
> put line;
> if index(line,"DATEMARK") then do;
> if index(line,"WAR") then put "Harry Potter and the Funny Mushrooms";
> 1) The input file is nicely indented and formatted. The output file is
> left-justified. I assume this is because $varying gets rid of leading
> blanks, but I think I need to use $varying for this kind of read in/put
> logic. Any ideas how to preserve leading spaces?
> 2) If the input file does not have "DATEMARK" and "WAR", the files comes
> as desired. That is exactly, like it came in (except for problem #1). If
> "DATEMARK" and "WAR" are there however, it not only inserts my random
> but it also adds a "^M" (unix carriage-return character) to each line.
> ideas why it does this, and how to make it stop?
> Thanks for any help,