BookmarkSubscribeRSS Feed
Edwinl
Calcite | Level 5

I imported a text file and had been working on it and wanted to save. i.e permanently save under different library not work folder in sas Library

How can I save this. Below is the program. I want to save it as cholesterol2

Any help pleas

/*******************************************************

program         cr_cholesterol1

purpose         to format dates

creates                   dataset cholesterol

date amended

written

**********************************************************/

*location where
data is stored;

libname dcm_data 'F:\UQ\dcm\module 1';

data dcm_data.cholesterol;

infile'F:\UQ\dcm\module 1\cholesterol.prn'firstobs=2missover; *reading in raw data;

/*reading in alldata*/

input @6 id 3. @16 cholest 1. @20 gender $1. @30 systolic 3. @38 diastolic 3. @46 height 3. @54 weight 3. @64 ses 1. @73 don ddmmyy10./*date of birth*/ @89 date_assess ddmmyy10.;

*formating datevariables;

format dob ddmmyy10. date_assess date9.;

proccontents;

run;

1 REPLY 1
Tom
Super User Tom
Super User

Your is already saving the dataset.  (I assume the missing spaces between in the program are the result of copying and pasting.)

Your program is creating a dataset named cholesterol, you could just change the name in the DATA statement if you want to save it as another name.

If you want to save some other dataset that you have created then you could just run another data step.

data dcm_data.cholesterol2 ;

   set other_work_dataset ;

run;

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 703 views
  • 1 like
  • 2 in conversation