date - MONYY7. and DATE9. operations -


i'm working on big data set, (more 100 variables , 11 millions observations). in data set, have variable named dtdsi (simulation date) in date9. format. (for example: 01apr2015 , 02mar2015...). have macro-program analyse data set comparing observations in 2 different months:

 %macro analysis (data_input , m , m_1);  .....  %mend; 

the 2 macro-variables m , m_1 months want compare. format monyy7.(apr2015 , mar2015...). keep in mind cannot modify data_input (its data of company). in beginning of macro program, want create new data set observations of &m , &m_1 month. can creating new date variable dtdsi (real_month ex) in format monyy7. select observations real_month equal &m or real_month equal &m:

data new; set &data_input; mois_real = input(dtdsi,monyy7); run;  proc sql; create table new as; select * mois_real in ("&m" , "&m_1") new; .... 

the problem in first data statement, duplicated data_input; bad because took 30 minutes. can tell me how can make selection (dtdsi = m , dtdsi=m_1) right in first statement?

you can use formula's in where/if condition, apply formula step 1 step 2 or vice versa.

data new; set &data_input; put(dtdsi,monyy7) in ("&m" , "&m_1"); run; 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -