An Idea Exchange for SAS software and services

by PROC Star
‎10-13-2017 04:57 PM - edited ‎10-13-2017 05:00 PM

You can add a WHERE option to your PROC TRANSPOSE out= dataset.  Is this what you want? :


proc transpose data = sample_data
               out  = sample_transpose(rename=(_NAME_=key
                                       where=(value ne 0)
    var a b c d e f g;
    by id;

If you have millions of records to transpose, this wouldn't help with the efficiency of the actual transposing (I would think all those values of 0 would still be transposed when the PROC runs), but at least they would not be written to the output dataset, so you would save time in writing the output. 

by Super User
on ‎10-15-2017 04:28 PM

An option in the same area could be to opt for excluding missing values, this would IMO make some sense as pre defined options.

Other filtering should be fine using where= ds options as @Quentin suggested.

Idea Statuses
Top Liked Authors