BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
Hi experts i am confusing about _infie_ automatic variable can anyone give detailed explanation with example except sas documentation
2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

This is the article that made me understand it

 

https://www.lexjansen.com/nesug/nesug01/cc/cc4018bw.pdf

 

Hope it helps 🙂

ballardw
Super User

_infile_ basically holds the current entire line of an external file being read. So you can treat it much like any other string variable .

 

Brief example:

data example ;
   infile datalines truncover;
   input x $25.;
   put 'when read: ' _infile_;
   _infile_ = translate(_infile_,'X3L','1el');
   put 'when modified: ' _infile_;
datalines;
1 
some text
null
3
;

I have mostly used the variable for parsing badly structured files to find key lines in the data and executing condition Input statements.

 

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!

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