BookmarkSubscribeRSS Feed
Tip Semanal: Manipulación de DATAS con SAS – Parte 3
Berenice25
SAS Employee

Usando el mismo código que la semana anterior, solo usaré los formatos para mostrar las fechas usando nuestro idioma español. Para ello utilizaremos la OPTION LOCALE y también las funciones específicas asociadas

 

options locale=es_es;

y ahora use los FORMATOS NLDATE (hay varios en SAS HELP CENTER: NLDATELw. Format) y la función put para guardar los valores.

 

¿Cómo saber el día de la semana? SAS Help Center: NLDATEWNw. Format

¿Qué semana del año?  SAS Help Center: NLDATEYWw. Format

¿Qué es el Trimestre del Año? SAS Help Center: NLDATEYQw. Format

 

data boletos_2023;
 set boletos_2023;
 semana_do_ano =  put (vencimento, nldateyw20.);
 trimestre = put(vencimento,  nldateyq200.);
 dia_da_semana = put (vencimento,nldatewn10.);
run;

Berenice25_0-1686936623295.png

 

 

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!
Article Labels
Contributors