To obtain a list of filenames in a specific directory, use the Files In Directory command.
names = Files In Directory( path, <recursive> );
names = Files In Directory( "$SAMPLE_DATA" );
{ "2D Gaussian Process Example.jmp", "Abrasion.jmp", ... "Design Experiment", "Detergent.jmp", ... }
Notice that the files within the Design Experiment subdirectory are not included. And only files in the root $SAMPLE_DATA directory are listed.
names = Files In Directory( "$SAMPLE_DATA", recursive );
{ "2D Gaussian Process Example.jmp", "Abrasion.jmp", ... "Design Experiment/2x3x4 Factorial.jmp", "Design Experiment/Algorithm Data.jmp", ... }
To get the full pathnames, recurse the directories and concatenate the file paths and file names. The following example loops through each file in the $SAMPLE_DATA directory and subdirectories. The file path is concatenated to each file name.
names = Files In Directory( "$SAMPLE_DATA", recursive );
For( i = 1, i <= N Items( names ), i++,
names[i] = Convert File Path( "$SAMPLE_DATA" ) || names[i]
);
names;
{"/C:/Program Files/SAS/JMP/14/Samples/Data/2D Gaussian Process Example.jmp",
"/C:/Program Files/SAS/JMP/14/Samples/Data/Abrasion.jmp", ... }
The Files in Directory command accepts native and POSIX paths, as well as paths using path variables. See Path Variables in Types of Data for details on working with paths.