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 (March 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 18 Mar 2011 13:08:45 -0400
Reply-To:     Philip C <SASL.PhilipC@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Philip C <SASL.PhilipC@GMAIL.COM>
Subject:      set and file
Content-Type: text/plain; charset=ISO-8859-1

I need some guidance please. I'm puzzled by the interaction between the set statement and the file statement in the code below. This code works well if DATASET has 1 or more records. It doesn’t work well if the DATASET has zero records. If there are zero records, then NO records are output to XLFILE. My desire is to have at least the last PUT statement to be outputted to XLFILE, in the case that there are no records in DATASET. This code is my latest unsuccessful attempt to do this.

data _null_; file XLFILE; do until (eof); set DATASET (WHERE=(TYPE=10)) end=eof nobs = nobs ; if nobs then do; put dornum "09"x fullname "09"x office "09"x "09"x "09"x"09"x "09"x &COMMENT; end; end; put "09"x "09"x "09"x "09"x "09"x "09"x "09"x "&OBIS_Data_Comment"; stop; run;


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