@Gauri123-56 wrote:
If record doesn't exist then save it in excel file
Yes, much more explanation is needed. In particular, you are saying if something doesn't exist then save it ... you can't save something that doesn't exist. That requires a very clearly worded statement of what you want.
How do you intend to search for "if the record exists"? Are you going to supply a specific value for a named variable? Multiple variables? Do you know the names of the variables before hand? Actual values?
What exactly is an "input file"? What format are the files? Where to do the input files reside? Do you expect to read the input file into a SAS data set?
What exactly is the output supposed to look like? A list of record definitions? All of the data?
How many "input files" are we talking about? Is the name of the input file supposed to be part of the output?
Just a few of the details that need to be addressed.
In addition to defining more of the question, as others have mentioned, it's very helpful if you will share the code you have tried, and describe the problems with it (errors, not desired results, etc.) As general advice, most folks recommend starting with working SAS code (DATA steps and procs) before trying to write a macro (which will generate the SAS code). Do you have SAS code that works like you want?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.