The fileInfo action lists the files in a caslib's data source. It provides detailed metadata about files, including permission, owner, group, size, and modification time. This action is essential for exploring available data files and can calculate row counts for supported file types. You can use wildcard characters to filter the file list based on name patterns.
| Parameter | Beschreibung |
|---|---|
| allFiles | When set to True, lists all file types in the results. When set to False, lists all file types that are supported by the data connector specified in the caslib. |
| caslib | Specifies the name of the caslib for the output table. |
| dataSourceOptions | Specifies data source options (e.g., for ADLS, S3, Hadoop, etc.). |
| includeDirectories | When set to True, includes directories in the results. |
| kbytes | When set to True, lists file sizes in kilobytes. |
| path | Specifies the file, directory, or table name. Supports wildcard characters (% and _) for pattern matching. |
| rowCount | When set to True, includes the number of rows in the results. Not supported by all data sources. |
| wildEscape | Specifies the character or characters to use for escaping wildcard characters. |
| wildignore | When set to True, the characters % and _ are not interpreted as wildcard characters. |
| wildsensitive | When set to False and wildcards are used, names are matched without regard to case. |
Loads the SASHELP.CARS dataset into CAS and saves it as a CSV file in the active caslib (Casuser) to ensure a file exists for listing.
| 1 | |
| 2 | DATA casuser.cars; |
| 3 | SET sashelp.cars; |
| 4 | |
| 5 | RUN; |
| 6 | |
| 7 | PROC CAS; |
| 8 | TABLE.save / TABLE={name="cars", caslib="casuser"} name="cars.csv" caslib="casuser" replace=true; |
| 9 | |
| 10 | RUN; |
| 11 |
Retrieves a list of all files available in the active caslib (typically Casuser).
| 1 | PROC CAS; TABLE.fileInfo / caslib="casuser"; RUN; |
Lists only files with the '.csv' extension (case-insensitive), displays their size in kilobytes instead of bytes, and calculates the number of rows in each file.
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.fileInfo / caslib="casuser" path="%.csv" kbytes=true rowCount=true wildSensitive=false; |
| 4 | |
| 5 | RUN; |
| 6 |