LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2011, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 9 Mar 2011 09:16:46 -0500
Reply-To:     Nuria Chapinal <nchapinal@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nuria Chapinal <nchapinal@YAHOO.COM>
Subject:      Re: problems importing datetimes from csv files

I am still having trouble understanding what this loop of the code does, though. I know what the calf = input(etc...) does because I created it. It is taking a bit of the filename.... but the loop itself... I can't figure it out....

input @; if _n_ eq 1 or eov then do; calf =input( scan (input (scan(fname,-1,'_'), $12.),1), 12.); retain filename calf; eov = 0; input #2; delete; end;

in the final code: filename FT46F001 'C:\Users\nuria\Desktop\hobo\c\*.csv' lrecl=256; data nc; length fname $256; infile FT46F001 dlm=',' dsd eov=eov filename=fname truncover ; input @; if _n_ eq 1 or eov then do;

calf =input( scan (input (scan(fname,-1,'_'), $12.),1), 12.); retain filename calf; eov = 0; input #2; delete; end; input obs: 9. dtx:$30. (y z) (:9.) ;

date= input(scan(dtx,1,' '),ddmmyy8.); time = input (substr (dtx, 10, 14), time12.); format date date.; format time time.; hour =hour (time); run;


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