?>Array ( [lang] => fr [id] => 105 )
Scénario de test & Cas d'usage
Création d'une table `TRANSACTIONS_FIN` avec des codes de transaction qui nécessitent une catégorisation complexe.
| 1 | DATA casuser.TRANSACTIONS_FIN; |
| 2 | INPUT ID_Txn $ Code_Txn; |
| 3 | DATALINES; |
| 4 | TXN_A 101 |
| 5 | TXN_B 205 |
| 6 | TXN_C 302 |
| 7 | TXN_D 404 |
| 8 | ; |
| 9 | RUN; |
| 1 | PROC CAS; |
| 2 | sessionprop.addFmtLib fmtLibName="financeLib"; |
| 3 | RUN; |
| 1 | PROC CAS; |
| 2 | sessionprop.addFormat |
| 3 | fmtLibName="financeLib" |
| 4 | fmtName="$AttributsTxn" |
| 5 | multiLabel=true |
| 6 | notSorted=true |
| 7 | ranges={"'101'='Virement'", "'101'='International'", "'205'='Prélèvement'", "'302'='Frais Bancaires'", "'302'='Domestique'"}; |
| 8 | RUN; |
| 1 | PROC CAS; |
| 2 | sessionprop.addFormat |
| 3 | fmtLibName="financeLib" |
| 4 | fmtName="$DescTxn_FR" |
| 5 | locale='fr_FR' |
| 6 | replace=true |
| 7 | ranges={"'101'='Virement International'", "'205'='Prélèvement Automatique'", "'302'='Frais de Service'", "'other'='Inconnu'"}; |
| 8 | RUN; |
| 1 | PROC CAS; |
| 2 | sessionprop.addFormat |
| 3 | fmtLibName="financeLib" |
| 4 | fmtName="$DescTxn_EN" |
| 5 | locale='en_US' |
| 6 | replace=true |
| 7 | ranges={"'101'='International Wire'", "'205'='Direct Debit'", "'302'='Service Fee'", "'other'='Unknown'"}; |
| 8 | RUN; |
| 1 | DATA casuser.REPORTING_TXN; |
| 2 | SET casuser.TRANSACTIONS_FIN; |
| 3 | FORMAT Code_Txn $AttributsTxn.; |
| 4 | Attributs = put(Code_Txn, $AttributsTxn.); |
| 5 | Description_FR = put(Code_Txn, $DescTxn_FR.); |
| 6 | Description_EN = put(Code_Txn, $DescTxn_EN.); |
| 7 | RUN; |
| 8 | |
| 9 | PROC PRINT DATA=casuser.REPORTING_TXN; |
| 10 | RUN; |
La table finale `REPORTING_TXN` doit contenir 3 nouvelles colonnes. La colonne 'Attributs' doit afficher plusieurs libellés pour un même code (ex: 'Virement' et 'International' pour le code 101). Les colonnes 'Description_FR' et 'Description_EN' doivent afficher les descriptions respectives dans la bonne langue, démontrant la capacité à gérer des formats multilingues et multi-labels.