LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 19 May 2008 11:50:44 -0400
Reply-To:   Talbot Michael Katz <topkatz@MSN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Talbot Michael Katz <topkatz@MSN.COM>
Subject:   Re: Transfer from Windows to UNIX
Comments:   To: Mark Keintz <mkeintz@WHARTON.UPENN.EDU>

Hi Mark.

Thank you for responding. I tried the ASCII mode FTP, and that appeared to get UNIX to work the same way as Windows with no modifications to the program.

Thanks again to all who responded, on or offline.

-- TMK -- "The Macro Klutz"

On Mon, 19 May 2008 10:51:20 -0400, Keintz, H. Mark <mkeintz@WHARTON.UPENN.EDU> wrote:

>Talbot asks why his SAS program on UNIX appears to add 1 byte to the >length of character variables from a sequence of ascii records following >his CARDS statement. > >Tablot, this has the markings of failure to convert the two byte >line-termination codes (carriage-return, followed by a line-feed) used >by windows to the single-byte code (line-feed only) used by unix. As a >result the value "potatoes" is seen by unix sas as "potatoes " where the >trailing blank is really a non-printable trailing carriage return. > >If this is the problem, then you have options: > > 1. If you ftp the program from windows to unix, be sure to use the >ascii mode. >or > 2. put the data in a separate file and use the INFILE statement with >the "termstr=crlf" option. >Or > 3. After moving the program to unix,open it up with any of a number of >unix editors (I use PICO) make a minor modification to the program (e.g. >move a semi-colon) and save the file. At least on our unix system the >editor is smart enough to recognize the extraneous carriage-return and >delete it upon saving. > >Note if you had been reading numeric instead of character data, you >would have gotten error messages about invalid values. > > >Regards, >Mark > > > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >Talbot Michael Katz >Sent: Monday, May 19, 2008 10:05 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Transfer from Windows to UNIX > >Hi. > >I have code that needs to run on both Windows and UNIX platforms. If I >have a data step created in Windows that reads in data lines as follows: > >data ds1 ; > length var1 $16. ; > INFILE CARDS ; > input var1 $ ; > n + 1 ; > var1len = length(var1) ; >cards ; >potatoes >CABBAGE >Beans >; >run ; > >then running in UNIX sees an extra character at the end (and the >corresponding lengths are all one bigger). Is there a way to modify the >infile and / or input statements and / or system options (and / or >something else) so that the code still works the same way in Windows, >and >works the same way in UNIX as it does in Windows? Do I have to use a >macro that tests &sysscp or &sysscpl ? (If so, what's the most >efficient >way?) > >Thanks! > >-- TMK -- >"The Macro Klutz"


Back to: Top of message | Previous page | Main SAS-L page