BookmarkSubscribeRSS Feed
gee21
Calcite | Level 5

Hi All;

 

I a new in this community, I have a problem with data statement. I write a simple program as example:

 

data AUTOFILL_SERIAL;

set NWK.ALL2019;

do no=RANGE_START to RANGE_END;

output;

end;

run;

 

May I know how the program look likes if I need to save the output direct to permanent folder name 'NWK'. currently the output save directly to temporary Work Libraries.

 

tks

gee

3 REPLIES 3
Reeza
Super User
SAS uses a two level naming system:

libName.dataSetName

You would first create a libname reference to the folder and then change your data statement to be:

libname nwk 'path to folder';
data nwk.autofill_serial;

gee21
Calcite | Level 5

Hi Rezza;

 

sorry not really familiar with program.  Did I just need to add the libname as below .

 

libname NWK;

data NWK AUTOFILL_SERIAL;

set NWK.ALL2019;

do no=RANGE_START to RANGE_END;

output;

end;

 

run;

 

Still error , actually how the program should look like.

 

tks

gee

Reeza
Super User

It's literally the code I wrote. You have to fill in the path and replace your data statement. 


@gee21 wrote:

Hi Rezza;

 

sorry not really familiar with program.  Did I just need to add the libname as below .

 

libname NWK;

data NWK AUTOFILL_SERIAL;

set NWK.ALL2019;

do no=RANGE_START to RANGE_END;

output;

end;

 

run;

 

Still error , actually how the program should look like.

 

tks

gee


Test this:

 

 

libname nwk 'path to folder';

data nwk.demo;
set sashelp.class;
run;

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 779 views
  • 0 likes
  • 2 in conversation