Hi: We have an example of using %PUT with the automatic Macro variables in our Programming 2 class. To learn about the automatic macro variables, here's the documentation site: http://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#n18mk1d0g1j31in1q6chazvfseel.htm Your original question is nearly impossible to answer: "How can you get latest dataset from SAS libraries?" -- because too much is unknown? For what purpose? Just a list of the latest dataset? To use the latest dataset in a subsequent program? What, exactly do they mean by the "latest" dataset? The last dataset created? The last dataset modified? The last dataset deleted? What do you mean by the word "get" -- "get the name", "get the data"? My tendency is to think that they were looking for &SYSLAST, which would show an understanding of at least Programming 1 and Programming 2 level concepts and skills. But,, it is nearly impossible to explain how you can write "this" in programming since the "this" you want has so many unknowns. cynthia
... View more