Desktop productivity for business analysts and programmers

Concatenating a letter when exporting

Reply
Occasional Contributor
Posts: 6

Concatenating a letter when exporting

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.

Super User
Posts: 11,134

Re: Concatenating a letter when exporting

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;

Respected Advisor
Posts: 3,156

Re: Concatenating a letter when exporting

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

Haikuo

Ask a Question
Discussion stats
  • 2 replies
  • 252 views
  • 0 likes
  • 3 in conversation