Les Clés
// Aujourd'hui, nous prenons la clé des champs !
//
// Le format libre a apporté de nouvelles façons
// de coder les clés d'accès aux fichiers :
//
// Clés à la volée
// %kds avec DS manuelle
// %kds avec DS "likerec"
Ftest035p if e k disk
* DS manuelle.
D cledsm ds inz
D champ1
D champ2
D champ3
* Une DS des clés du format du fichier est générée.
* Notez bien qu'il s'agit d'une data-structure qualifiée !
D cleds ds likerec(test035r:*key) inz
* Clé décrie en format fixe, hum !
C cle1 klist
C kfld champ1
C kfld champ2
C kfld champ3
/free
champ1='A';
champ2='B';
champ3=1;
chain cle1 test035r; // Utilise une clé décrie en format fixe, hum !
if not%found;
dsply 'C l é K l i s t ';
endif;
chain %kds(cledsm) test035r;
if not%found;
dsply 'C l é % K D S m a n u e l l e';
endif;
chain (champ1:champ2:champ3) test035r;
if not%found;
dsply 'C l é à la v o l é e';
endif;
cleds.champ1='A'; // Une DS "Likerec" est qualifiée !
cleds.champ2='B';
cleds.champ3=1;
chain %kds(cleds) test035r;
if not%found;
dsply 'C l é e n % K D S L i k e r e c';
endif;
chain %kds(cleds:2) test035r;
if not%found;
dsply 'C l é e n % K D S L i k e r e c';
dsply 'avec le nombre de zones à considérer dans la DS.';
endif;
*inlr=*on;
return;
/end-free
//
// Le format libre a apporté de nouvelles façons
// de coder les clés d'accès aux fichiers :
//
// Clés à la volée
// %kds avec DS manuelle
// %kds avec DS "likerec"
Ftest035p if e k disk
* DS manuelle.
D cledsm ds inz
D champ1
D champ2
D champ3
* Une DS des clés du format du fichier est générée.
* Notez bien qu'il s'agit d'une data-structure qualifiée !
D cleds ds likerec(test035r:*key) inz
* Clé décrie en format fixe, hum !
C cle1 klist
C kfld champ1
C kfld champ2
C kfld champ3
/free
champ1='A';
champ2='B';
champ3=1;
chain cle1 test035r; // Utilise une clé décrie en format fixe, hum !
if not%found;
dsply 'C l é K l i s t ';
endif;
chain %kds(cledsm) test035r;
if not%found;
dsply 'C l é % K D S m a n u e l l e';
endif;
chain (champ1:champ2:champ3) test035r;
if not%found;
dsply 'C l é à la v o l é e';
endif;
cleds.champ1='A'; // Une DS "Likerec" est qualifiée !
cleds.champ2='B';
cleds.champ3=1;
chain %kds(cleds) test035r;
if not%found;
dsply 'C l é e n % K D S L i k e r e c';
endif;
chain %kds(cleds:2) test035r;
if not%found;
dsply 'C l é e n % K D S L i k e r e c';
dsply 'avec le nombre de zones à considérer dans la DS.';
endif;
*inlr=*on;
return;
/end-free
Publicité
Partager cet article
Pour être informé des derniers articles, inscrivez vous :
Commenter cet article
/image%2F1025633%2F20151122%2Fob_b0e74c_pam007i.png)