Scénario de test & Cas d'usage
Create a simple table representing experimental results.
| 1 | DATA casuser.lab_results; |
| 2 | INPUT SubjectID $ Measurement; |
| 3 | DATALINES; |
| 4 | SUBJ-01 9.5 |
| 5 | SUBJ-02 11.2 |
| 6 | SUBJ-03 8.9 |
| 7 | ; |
| 8 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.loadTable / |
| 3 | caslib='CASUSER' |
| 4 | path='lab_results.sashdat' |
| 5 | casOut={name='LAB_RESULTS', replace=true}; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.attribute / |
| 3 | task='ADD' |
| 4 | name='LAB_RESULTS' caslib='CASUSER' SET='Annotations' |
| 5 | attributes={{key='ReviewNote', value='Data looks good; verified by O''Malley. Final check pending.'}}; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.attribute / |
| 3 | task='DROP' |
| 4 | name='LAB_RESULTS' caslib='CASUSER' SET='Annotations' |
| 5 | attributes={{key='NonExistentKey'}}; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.attribute / |
| 3 | task='UPDATE' |
| 4 | name='LAB_RESULTS' caslib='CASUSER' SET='Annotations' |
| 5 | attributes={{key='ReviewNote', value='New Value', column='NonExistentColumn'}}; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | TABLE.attribute / |
| 3 | task='DROP' |
| 4 | name='LAB_RESULTS' caslib='CASUSER' SET='Annotations' |
| 5 | attributes={{key='ReviewNote'}}; |
| 6 | RUN; |
| 7 | QUIT; |
Step 2 succeeds. Step 3 completes without error, but the log should indicate that the attribute to be dropped was not found. Step 4 fails with a clear error message in the SAS log stating the column 'NonExistentColumn' does not exist. Step 5 succeeds, removing the 'ReviewNote' attribute. This confirms the action's robustness in handling both valid and invalid user operations.