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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

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