Created
February 15, 2024 15:08
-
-
Save hdary85/bff26f91d2ad82b9f1bcbeed7f87e288 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Déclaration de la macro variable */ | |
%let date_sas = '01JAN2023'd; | |
/* Extraction de v1 */ | |
data _null_; | |
/* Conversion de la date en format numérique YYYYMM */ | |
v1 = year(&date_sas.) * 100 + month(&date_sas.); | |
call symputx('v1', v1); | |
run; | |
/* Extraction de v2 */ | |
data _null_; | |
/* Conversion de la date en format ISO8601 */ | |
v2 = put(&date_sas., datetime20.); | |
call symputx('v2', v2); | |
run; | |
/* Affichage des résultats */ | |
%put v1 = &v1; | |
%put v2 = &v2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment