BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mystik
Obsidian | Level 7

Hello,

 

I am running this data (called drases) and wanted the resulting SAS data to be created (tcalled all_drases), to be stored in one of my Library folders (called jdata) instead of that file automatically going into Work folder.

 

Please what is the appropriate SAS programming for this?

 

 

Below is the SAS program i am running;

 

libname samma "F:\samma";

 

data drases;

set samma.drases;

 

data all_drases;

set drases;

if crodcode in (678, 790, 890, 898, 920, 930, 940) then alc_grp="AMAS";

if crodcode in (67, 87, 93, 97, 98, 99, 1028, 8282, 82829, 63789) then alc_grp="AMAL";

run;

1 ACCEPTED SOLUTION

Accepted Solutions
Shmuel
Garnet | Level 18

Just use the library for output as you used it for input:

data jdata.all_drases;  /* line changed */

set drases;

if crodcode in (678, 790, 890, 898, 920, 930, 940) then alc_grp="AMAS";

if crodcode in (67, 87, 93, 97, 98, 99, 1028, 8282, 82829, 63789) then alc_grp="AMAL";

run;

View solution in original post

2 REPLIES 2
Shmuel
Garnet | Level 18

Just use the library for output as you used it for input:

data jdata.all_drases;  /* line changed */

set drases;

if crodcode in (678, 790, 890, 898, 920, 930, 940) then alc_grp="AMAS";

if crodcode in (67, 87, 93, 97, 98, 99, 1028, 8282, 82829, 63789) then alc_grp="AMAL";

run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 972 views
  • 2 likes
  • 2 in conversation