BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
data where_infile;
infile'/home/u35263349/My_Folder/class_ds.txt';
input Name$  Sex$  Age Height Weight ;
if Sex='F'; 
run;

Here i am import sashelp.class txt file  and filter with if Clause 

where cannot work with infile statement 

but i didn't get output even if using IF statement where went work

 

 

3 REPLIES 3
ballardw
Super User

@BrahmanandaRao wrote:
data where_infile;
infile'/home/u35263349/My_Folder/class_ds.txt';
input Name$  Sex$  Age Height Weight ;
if Sex='F'; 
run;

Here i am import sashelp.class txt file  and filter with if Clause 

where cannot work with infile statement 

but i didn't get output even if using IF statement where went work

 

 


Show the log that was created when the code ran.

Always when output was not as expected.

Copy the text from the LOG and paste into a text box opened on the forum with the </> icon.

 

Sajid01
Meteorite | Level 14

Hello @BrahmanandaRao 
It is possible that the columns are tab separated. Other wise Your code code should work. If it is indeed tab separated use the following modification

data where_infile;
infile'/home/u35263349/My_Folder/class_ds.txt' dlm ='09'x dsd missover;
input Name $  Sex $  Age Height Weight ;
if Sex='F'; 
run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1234 views
  • 1 like
  • 4 in conversation