Hi,
I have one external text file that i like to append to another but i dont like to read them in into a dataset as the files have many variables. And they both have the same layout. How do i do that?
Use your OS commands - in Unix its cat, may be in powershell as well.
Do you have headers you need to deal with or is it straight appending of the two text files.
Use your OS commands - in Unix its cat, may be in powershell as well.
Do you have headers you need to deal with or is it straight appending of the two text files.
Thx guys. The cat command works perfectly
filename infile ("path_to_file_a","path_to_file_b") options;
if you want to read them in one step.
Otherwise, use the X statement or call system to do it with a suiting OS command, as Reeza suggested.
You can make use of the MOD option of the FILE statement, this will allow you to add new records to an existing external file.
see this sample code, that illustrates this:
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.