BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

A colleague suggested me to use the option dlm='|' to force to read the complete line.

But I wonder if there is a better option or combined options to do that .

 

Here's the code :

 

filename filelist pipe "find /folder1/sasdata/TestActuariat/ -type f ";
data fileslisting2;
length text $1000.;
infile filelist dlm='|';
input text;
run;

Here's an observation of fileslisting2;

Does the option dlm='|' is a good one or can we do better?

 

/folder1/sasdata/TestActuariat/Conversion Classic/Cycle3/gc/habi/gc_res_prop_jul2018.dpf.00010f97.0.1.spds9

 

Without the good option we get:

 

/folder1/sasdata/TestActuariat/Conversion

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
SAS Super FREQ

If you want to get the entire content of the input buffer into the text variable, why not just use an assignment statement, like this:

filename filelist pipe "find /folder1/sasdata/TestActuariat/ -type f ";
data fileslisting2;
   length text $1000.;
   infile filelist;
   input;
   text=_infile_;
run;

This technique will capture all of the text, even if it contains a pipe character (|). 

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

1 REPLY 1
SASJedi
SAS Super FREQ

If you want to get the entire content of the input buffer into the text variable, why not just use an assignment statement, like this:

filename filelist pipe "find /folder1/sasdata/TestActuariat/ -type f ";
data fileslisting2;
   length text $1000.;
   infile filelist;
   input;
   text=_infile_;
run;

This technique will capture all of the text, even if it contains a pipe character (|). 

Check out my Jedi SAS Tricks for SAS Users

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 303 views
  • 1 like
  • 2 in conversation