SAS Enterprise Guide

Desktop productivity for business analysts and programmers
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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