Aquí están los diferentes métodos para recuperar esta información, ya sea para crear macrovariables o para utilizarlas directamente en el código.
Note : 1. Recuperar la Fecha Actual (TODAY)
Para obtener la fecha actual, utilice la función today().
Opción A: Crear una macrovariable (valor bruto) Esto almacena la fecha como un número (el número de días desde el 01/01/1960). Útil para cálculos.
%let today_raw = %sysfunc(today());
/* Résultat exemple : 23456 */
1
%let today_raw = %sysfunc(today());
2
3
/* Résultat exemple : 23456 */
Note : Opción B: Crear una macrovariable (formateada) Si necesita una fecha legible (ej: para un título de informe o un nombre de archivo), agregue un formato como segundo argumento en %sysfunc.
The codes and examples provided on WeAreCAS.eu are for educational purposes. It is imperative not to blindly copy-paste them into your production environments. The best approach is to understand the logic before applying it. We strongly recommend testing these scripts in a test environment (Sandbox/Dev). WeAreCAS accepts no responsibility for any impact or data loss on your systems.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.