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

Now I have a acustomer list D:\cust_list.txt,and this text has one column "party_no"(the max length is 22),and the first row of this txt is column name.Please tell me how to import  it to library 'puball' with data step.

 

thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Two minor changes to the code posted by @VDD:

 

filename datain "D:\cust_list.txt";
libname puball "....";

data pubull.want;
  infile datain firstobs=2;
  input @1 party_no $22.;
run;

In production jobs i always recommend not to overwrite a permanent dataset with an importing step, but to store the imported data in a temporary dataset first and copy the dataset to the library after it has been verified that the import was successful.

View solution in original post

2 REPLIES 2
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

this should give you want you asking for.

filename datain "D:\cust_list.txt";
data want;
  infile datain;
  input @1 party_no $22.;
run;

andreas_lds
Jade | Level 19

Two minor changes to the code posted by @VDD:

 

filename datain "D:\cust_list.txt";
libname puball "....";

data pubull.want;
  infile datain firstobs=2;
  input @1 party_no $22.;
run;

In production jobs i always recommend not to overwrite a permanent dataset with an importing step, but to store the imported data in a temporary dataset first and copy the dataset to the library after it has been verified that the import was successful.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 982 views
  • 2 likes
  • 3 in conversation