Based on the very thin information you share:
Using a data step you could check in the first line of your data if there is a tab and only proceed with the import if there isn't one.
In a data step it is easy to see if first record contains commas or tabs.
data chartest; infile "your file goes here" obs=1 ; input; if index(_infile_,"09"X)>0 then <do something when tab is found>; ;
Without see a lot more of your code, such as how you are getting the file names or reading the data I can't provide a lot of details of what the "do something" should be. A very likely option would be the STOP statement to end the execution.
Your problem description is missing a lot of pertinent issues.
So let's assume that you want to run a single data step that reads all of the files using a wildcard in the INFILE statement.
So first make sure you know how to tell which file you are reading (and so when you change files).
When starting a new file check if the it is one you want to read or skip.
data want;
length fname $256 ;
infile "myfiles*.txt" filename=fname truncover dsd ;
input @;
if fname ne lag(fname) then do;
if indexc(_infile_,'09'x) then skip=1;
else skip=0;
end;
if not skip then do;
input .... ;
output;
end;
run;
If the issue is that the data is same but sometimes they use tab and sometimes they use comma then you can just modify the value used by the DLM option of the infile statement.
data want;
length dlm $1 ;
infile "myfiles*.txt" truncover dsd dlm=dlm;
input @;
if indexc(_infile_,'09'x) then dlm='09'x;
else dlm=',';
input .... ;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.