Hello
What is the meaning of "-L" in following code and why do we need it?
I see that I get same result without using "-L"
data example;
x1=201711;/*Numeric date 201711*/
x2=put(x1,6.);/*char date 201711*/
x2_way2=put(x1,6.-L);/*char date 201711*/
run;
Hello
Thank you for the answer.
I still don;t understand .
In both cases(with and without "-L" I see same result *201711*
Can you show an example when it effect the result?
You don't see a difference because the length of the format matches the number of digits, so there are no leading spaces.
Run this as an example:
data example;
x1=201711; /*Numeric date 201711*/
x2=put(x1,8.); /*char date 201711*/
x2_way2=put(x1,8.-L); /*char date 201711*/
put '*' x2 char8. '*';
put '*' x2_way2 char8. '*';
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.