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

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

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