BookmarkSubscribeRSS Feed
SystemsasdD2019
Calcite | Level 5

Hello , please I work on PROC VARMA  , I want to forecast with daily data , from 2020Jun1,2020Jun2, ,,,,, ,     2021Dec31. how can I write the format daily data . thanks

7 REPLIES 7
sbxkoenk
SAS Super FREQ

Hello @SystemsasdD2019 ,

 

I have moved your question to the "SAS Forecasting and Econometrics" board.

 

Do you mean PROC VARMAX?

 

In the PROC VARMAX, you need the ID statement with interval=DAY.

PROC VARMAX options; 
ID variable INTERVAL=value <ALIGN=value>; 

Or do you want to know how to convert a string like '2021Dec31' into a real SAS date?

 

Cheers,

Koen

SystemsasdD2019
Calcite | Level 5

Hello, thanks for answering , I want to know how to convert a string like ,    2021Jun1   ...  .... 2021Dec31'into a real SAS date,

sbxkoenk
SAS Super FREQ
data _NULL_;
LENGTH DateStringToConvert DateStringToConvert1 $ 9;

DateStringToConvert ='2021Jun1' ; 
DateStringToConvert1=trim(substr(DateStringToConvert,8,2))!!substr(DateStringToConvert,5,3)!!substr(DateStringToConvert,1,4);
put DateStringToConvert1=;
RealSASdate=input(DateStringToConvert1,date9.);
put RealSASdate=;
put RealSASdate= date9.;

DateStringToConvert='2021Dec31';
DateStringToConvert1=trim(substr(DateStringToConvert,8,2))!!substr(DateStringToConvert,5,3)!!substr(DateStringToConvert,1,4);
put DateStringToConvert1=;
RealSASdate=input(DateStringToConvert1,date9.);
put RealSASdate=;
put RealSASdate= date9.;

run;
/* end of program */

 

Koen

SystemsasdD2019
Calcite | Level 5

hello, excuse , I could not implement this formula , Is there a simpler formula . 

 

 

sbxkoenk
SAS Super FREQ

Hello,

 

Using PROC FORMAT and a picture statement, it is really easy to create ANY format for a date.
But it is more difficult to create any INformat for a date.

 

I will have a look in the coming week (workdays).

 

Thanks,

Koen

SystemsasdD2019
Calcite | Level 5

hello, excuse , can you show me how Using implement PROC FORMAT and a picture statement, with thanks

sbxkoenk
SAS Super FREQ

See here for examples :

Paper 101-27
Have a Strange DATE? Create your own INFORMAT to Deal with Her
Venky Chakravarthy, Ann Arbor, MI

https://support.sas.com/resources/papers/proceedings/proceedings/sugi27/p101-27.pdf

 

Koen

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 675 views
  • 1 like
  • 2 in conversation