BookmarkSubscribeRSS Feed
danfavero
Calcite | Level 5

Dear All,

I would like to know how can I add a letter to the PUT statement below:

data _null_;
infile test ;
  file '/sas/sasdata/FOLDER/FILE.txt';
input;

/*Here I need to add the letter D + the content so it would be like PUT 'D' || _infile_; but it doenst work */

put _infile_;
run;

I believe it is pretty basic put I'm struggling to find a solution.

2 REPLIES 2
ballardw
Super User

Add the _infile_ option to the INFILE statement so you have a variable to manipulate:

infile test _infile_=tvar;

Then

tvar='D'||tvar;

put tvar;

Haikuo
Onyx | Level 15

Replace : PUT 'D' || _infile_;  with put 'D' _infile_;

Haikuo

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1317 views
  • 0 likes
  • 3 in conversation