BookmarkSubscribeRSS Feed
stan
Quartz | Level 8

For example, I have the files (within the same directory) named with

human_CDx+CDx+xxh_1way_RM_ANOVA

common fragment in its names.

The inner structure of the files is as follows:

LINE with text

LINE with text

LINE with text

LINES with DATA

LINE with text

LINE with text

LINE with text

LINE with text

LINE with text

2 REPLIES 2
PGStats
Opal | Level 21

INFILE supports simple wildcard characters (both in Windows and Unix) for reading multiple files. Use filename= option to know where each observation comes from, as in

infile ('c:\myfiles\*.*','c:\myotherfiles\abc.dat') filename=whatFile;

PG

PG
stan
Quartz | Level 8

It works! But my intention is to make SAS compute different data sets

stored in '.txt' files located in a directory consequently. One by one.

There is an article at UCLA website:

SAS FAQ: How do I read multiple raw data files with the same structure in one data step?

But I get a big table with directories and data themselves instead of my SAS script

consecutive execusions with different data sets.

How to implement this?

Thanks for any response.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1378 views
  • 0 likes
  • 2 in conversation