From: Yaw on
Dear All:

My data step reading is not coming out right. Missing data points in
columns are be substituted by the next row data point.

My steps:

data maninput;
input ID dosemg;
datalines;
266 0.1
266 0.1
267
267
267 0.1
267 0.2
267 0.1
;run;

And here is the proc print output:

Obs ID dosemg

1 266 0.1
2 266 0.1
3 267 267.0
4 267 0.1
5 267 0.2
6 267 0.1


The first 2 clinics visits of ID 267 did not have any doses but in my
proc print, the first ID 267 is using the 2nd ID 267 as the dose(next
row over, and different column).

I want the IDs to show but no dose (i.e missing).

Any ideas? A more efficient way around this? Has anyone encountered
this before?

Thanks in advance,

Yaw
From: Arthur Tabachneck on
Yaw,

If I understand correctly, you are just missing one statement, namely
an infile statement that sets the truncover option. E.g.,

data maninput;
input ID dosemg;
infile cards truncover;
datalines;
266 0.1
266 0.1
267
267
267 0.1
267 0.2
267 0.1
;

HTH,
Art
-------------
On May 17, 2:01 pm, Yaw <link...(a)gmail.com> wrote:
> Dear All:
>
> My data step reading is not coming out right. Missing data points in
> columns are be substituted by the next row data point.
>
> My steps:
>
> data maninput;
>         input ID dosemg;
>         datalines;
>         266    0.1
>         266    0.1
>         267
>         267
>         267     0.1
>         267     0.2
>         267     0.1
>         ;run;
>
> And here is the proc print output:
>
>  Obs     ID    dosemg
>
>   1     266       0.1
>   2     266       0.1
>   3     267     267.0
>   4     267       0.1
>   5     267       0.2
>   6     267       0.1
>
> The first 2  clinics visits of ID 267 did not have any doses but in my
> proc print, the first ID 267 is using the 2nd ID 267 as the dose(next
> row over, and different column).
>
> I want the IDs to show but no dose (i.e missing).
>
> Any ideas? A more efficient way around this? Has anyone encountered
> this before?
>
> Thanks in advance,
>
> Yaw