BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

 

Patrick_0-1672056644605.png

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n1xdirhugd30qcn1szvchqcss3wv.h... 

 

Your variable fmt only contains values (format names) during run time and though you can't use it for the input function. 

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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.

 

--
Paige Miller
ErikLund_Jensen
Rhodochrosite | Level 12

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.

 

Patrick
Opal | Level 21

 

Patrick_0-1672056644605.png

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.2/lefunctionsref/n1xdirhugd30qcn1szvchqcss3wv.h... 

 

Your variable fmt only contains values (format names) during run time and though you can't use it for the input function. 

ErikLund_Jensen
Rhodochrosite | Level 12

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.

 

  • Start with a search on the community website. Most topics have been up for duscussion before. Or ask uncle Google, You will find answers to most questions if you do a search on "SAS <your topic>", and you can narrow it down and go directly to the manual with a search on "SAS 9.4 Documentation <your topic>".
  •  
  • If this doesn't help you, then ask the community. Don't start right out with a piece of code. Explain your problem and what you are trying to obtain, so there is a bit of context that opens up for alternative solutions to the problem. In other words: Don't ask how to climb the downpipe, ask how to get to the first floor.
  •  
  • If the question is about coding problems, post the full code and the full log, not a screenshot of the red lines only. Use the provided code boxes to paste code and log, so it is readable and easy to copy. In most cases it is necessary to run your code to provide an answer.
  •  
  • Always supply input data if possible, and post it as a data step with data lines pasted into a code box, so it can be copied. The person answering you needs data to work with, and it betters your chance of getting an answer if you lay the foundation. Never send screenshots of tables, and never ever send attached spreadsheets. Make a note if the "real" data source is a DBMS system and not SAS.
  •  
  • Write a line about your operating environment: SAS version, operating system, local SAS or Enterprise Guide and other relevant information.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1182 views
  • 4 likes
  • 4 in conversation