02-06-2016 11:24 AM
Starting with PC-SAS and have been giving a SAS dataset ccc.sas7bdat.
On that dataset is a variable that I have modified, I have made the new variable and dropped the previous variable.
How do I then get the new SAS dataset written back to the LIBNAME:
My current code:
libname wombat 'd:\rawdata';
data wombat.sra1 (drop = ssan); set one;
proc contents data=wombat.sra1;
data _null_; set wombat.sra1; file 'd:\rawdata\ddd.sas7bdat';
02-06-2016 12:05 PM
02-08-2016 12:22 PM
Thank you -- as a mainframe programmer of over 25 years, it has been too long understanding libraries and how to properly write out a file -- your code helped me realize that I needed to just use the libname and membernames of the dataset I was creating to get the job done. I got it to work so I thank you ! Scott S
02-06-2016 01:47 PM
Your code should be something like below. Please read the comments.
*Create library to get/put data; libname wombat 'd:\rawdata'; *bring dataset into work library from wombat library; data one (drop = ssan); /*new dataset to be created*/ set wombat.sra1; /*Dataset being read from*/ new_var=ssan*2; /*create new var*/ run; *examine contents of dataset one; proc contents data=one; run; *write back to library; data wombat.sra2; /*new dataset, back in wombat library*/ set one; /*dataset being read from*/ run;