Help using Base SAS procedures

blocking the values after a specific date

Frequent Contributor
Posts: 75

blocking the values after a specific date

I've got the following question.

I'm trying to run a partial least square forecast on a data model I have. Issue is that I need to block certain line in order to have the forecast for a specific time.

What I want would be the following. For June, every line before May 2014 will be blocked (see the screenshot below).


For May , every line before April 2014 will be blocked (see the screenshot below).


I was thinking of using a delete through a proc sql to do so but this solution seems to be very brutal and I wish to keep my table intact.

Question : Is there a way to block the line for a specific date with needing a deletion?

Edit : The aim of the blocking will be to use the missing values and to run the forecast on this missing month namely here in June 2014 and in May 2014 for the second example.

Plus: The mixture of English and French is normal because I've exported the file in a CSV format for a better vizualisation.

Many thanks for any insight you can give me as I've never done that before and don't know if there is a way to do that (I did not find anything on the net).

Super User
Super User
Posts: 9,599

Re: blocking the values after a specific date

Ha, this follows on from your other question.  Why not just assign a flag within a datastep for each group:

data ...;

     set ...;

     array flags{2} $1.;

     if nouv_date < '01JUN14'd then flag{1}="Y"; else flag{1}="N";

     if nouc_date < '01MAY14'd then flag{2}="Y"; else flag{2}="N";


Then you can use these flags later on as a where clause for each processing.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation