%LET inputlist= INPUT
State : $CHAR2.
Servicer : $CHAR25.
Date : /*$CHAR10.
The above is a snippet of code. It handles input from a share folder in which the date is inputted as a numeric. However because it is not recognized as an actual date the field shows a blank for that value. The only way I know around this is to read it in as a character then attempt to convert to a date. Is there a way to convert this to a date at initial input instead? I tried placing an 8. after Date: 8. however that does not show the date
We can't help unless you post what your date input data looks like and the actual full code that is reading it.
@Q1983 wrote:
%LET inputlist= INPUT
State : $CHAR2.
Servicer : $CHAR25.
Date : /*$CHAR10.
The above is a snippet of code. It handles input from a share folder in which the date is inputted as a numeric. However because it is not recognized as an actual date the field shows a blank for that value. The only way I know around this is to read it in as a character then attempt to convert to a date. Is there a way to convert this to a date at initial input instead? I tried placing an 8. after Date: 8. however that does not show the date
Depending on your source file format, practically anything not binary such as txt or CSV or tab delimited or fixed column, should not have a problem reading values using a format if you know which variable and which the format should be.
It might be as simple as using an INFORMAT statement before the input. It is a good idea to assign a display format as well so you aren't asking is 21347 the right value.
informat datevar date9. ;
format datevar date9.;
input <variables> datevar <more variables>;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.