LOADIMAGES Procedure

Getting Started: LOADIMAGES Procedure

(View the complete code for this example.)

The example in this section shows how to use the LOADIMAGES procedure to load an image from a directory. This example assumes that the CAS engine libref "mylib" and the caslib that is associated with "mylib" have already been created. For more information, see the section Setting Up Your Environment for Working with Images in Chapter 1, Shared Concepts.

The following PROC LOADIMAGES statement loads the image from the specified path into the mylib.images data table, which is specified in the OUTPUT statement. The specified path is relative to the caslib that is associated with the "mylib" libref:

proc loadimages libref=mylib path='myImages/sample.jpg';
   output out=mylib.images;
run;

You can view the contents of the output table by invoking PROC PRINT as follows. This displays the contents of the mylib.images data table that PROC LOADIMAGES generated.

proc print data=mylib.images;
run;

Figure 1 shows the output, which contains the image and metadata columns.

Figure 1: The mylib.images Data Table

Obs_image__size__path__type__id_
1...111893/path/to/images/myImages/sample.jpgjpg1


Last updated: March 26, 2026