fcmpact addPrototypes

Bulk Registration and Encoding of a Large Bioinformatics C-Function Library

Scénario de test & Cas d'usage

Business Context

A research institute is migrating a large library of proprietary C functions for genomic sequence analysis to SAS Viya. This test validates the action's ability to handle a large number of prototype definitions in a single call and secure them using the encoding and persistence features.
About the Set : fcmpact

Execution of SAS FCMP functions within the CAS environment.

Discover all actions of fcmpact
Data Preparation

This scenario simulates the registration of 100 external C function prototypes for bioinformatics. A SAS macro is used to generate the `routineCode` parameter string array to avoid manual repetition and test performance with a large number of inputs. The goal is to test performance, the `encode` option, and the `saveTable` option.

Copied!
1%macro generate_protos(num_protos);
2 %let proto_list =;
3 %DO i = 1 %to &num_protos;
4 %let proto_list = &proto_list "proto gene_analyzer_&i.(double) returns double;"
5 %IF &i < &num_protos %THEN %let proto_list = &proto_list,;
6 %END;
7 &proto_list
8%mend generate_protos;

Étapes de réalisation

1
Use a macro to generate 100 prototype definitions and execute the `addPrototypes` action with `encode=TRUE` and `saveTable=TRUE` to create a persistent, encoded library.
Copied!
1PROC CAS;
2 fcmpact.addPrototypes
3 routineCode={%generate_protos(100)},
4 package="GenomicsToolkit",
5 encode=true,
6 saveTable=true,
7 funcTable={name="genomics_lib", caslib="casuser", replace=true};
8RUN;
9QUIT;
2
Verify that the output table `genomics_lib.sashdat` has been saved to the caslib's physical path by checking the file system information.
Copied!
1PROC CAS;
2 TABLE.fileInfo caslib="casuser";
3RUN;
4QUIT;

Expected Result


The action should execute without performance degradation and create a permanent, encoded CAS table named `genomics_lib.sashdat` in the `casuser` caslib. The `table.fileInfo` result should list `genomics_lib.sashdat`, confirming its persistence. The log will confirm the successful creation and saving of the encoded table. It is not possible to directly view the encoded content, which is the expected behavior of `encode=true`.