vassilisef
Technical User
Hey ,
Just to let you know that I am not an experienced user.
My input data - in a comma delimited form - is the following :
Date,Price,Volume,Price,Volume
25/03/2005,15.78,1000,1.88,1500
05/09/2006,10.88,2000,0.77,2500
My desired input format would be :
Date Price Volume
25/03/2005 15.78 1000
25/03/2005 1.88 1500
05/09/2006 10.88 2000
05/09/2006 0.77 2500
My best attempt so far, would be:
data work.prices;
infile datalines dlm=',';
input date ddmmyy10.@;
input price volume @@;
format date ddmmyy10.;
datalines;
25/03/2005,15.78,1000,1.88,1500
05/09/2006,10.88,2000,0.77,2500
;
run;
However, this is wrong, because, as expected, when the Data step starts to iterate for the 2nd time, it attempts to read a date again - which does not exist.
I have a feeling that a retain statement for the date could be useful, but i cannot see where exactly it comes into play.
Thanks in advance,
Vassilis
Just to let you know that I am not an experienced user.
My input data - in a comma delimited form - is the following :
Date,Price,Volume,Price,Volume
25/03/2005,15.78,1000,1.88,1500
05/09/2006,10.88,2000,0.77,2500
My desired input format would be :
Date Price Volume
25/03/2005 15.78 1000
25/03/2005 1.88 1500
05/09/2006 10.88 2000
05/09/2006 0.77 2500
My best attempt so far, would be:
data work.prices;
infile datalines dlm=',';
input date ddmmyy10.@;
input price volume @@;
format date ddmmyy10.;
datalines;
25/03/2005,15.78,1000,1.88,1500
05/09/2006,10.88,2000,0.77,2500
;
run;
However, this is wrong, because, as expected, when the Data step starts to iterate for the 2nd time, it attempts to read a date again - which does not exist.
I have a feeling that a retain statement for the date could be useful, but i cannot see where exactly it comes into play.
Thanks in advance,
Vassilis