Your variable fmt only contains values (format names) during run time and though you can't use it for the input function.
Show us THE ENTIRE log for this data step. Use the </> icon. We have asked for this before, don't make us keep asking every time.
Hi @Ronein
Your code is a good demonstration of the difference.
INPUTN works, because it allows you to specify the format as a variable,
INPUT doesn't work because the format must be specified as a literal value, and - as the log says - there is no format defined with the name fmt.
278 SAS_date2=input(char_date,fmt); --- 85 76 ERROR 85-322: Expecting a format name. ERROR 76-322: Syntax error, statement will be ignored.
Your variable fmt only contains values (format names) during run time and though you can't use it for the input function.
I agree with @PaigeMiller
The community is not an online manual, it is a forum where community members use time (often long time) and imagination to solve your problem, and the best way to get a good answer is to post the question in a form that gives other members something to work with. A big part of the threads here is clarifying questions that would'nt have been necessary if proper information was provided from start. So here is my advices for getting a problem solved on the community. There is nothing new here, you can see these same advices in different wording in thousands of theads.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.