Converting Time Series Data to Range

2019-09-01 15:10发布

问题:

I just need the reverse of my Query raised at below link

SAS Dehoc Query...Breaking Range Data

I am having time series data and want to HOC it or want to convert it into range

Please advise

Thanks Hitesh

回答1:

This can be done quite simply with a proc SQL group by:

proc sql;
    create table output as
    select 
        ID,
        min(Date) as StartDT,
        max(Date) as EndDT,
        Shares as SharesOutStanding
    from input
    group by 
        ID,
        Shares;
quit;

Additional details here.



标签: sas