Bonjour,
J'ai essayé ta solution avec en FD un seul record "01 repert-input pic x(452)." J'ai pris la longueur du record le plus long de mon fichier input. Et en WS :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| 01 buffer-in.
03 societe pic x(50).
* 03 filler pic x.
03 departement pic x(50).
* 03 filler pic x.
03 salarie pic x(50).
* 03 filler pic x.
* 03 nom pic x(50).
* 03 filler pic x.
* 03 prenom pic x(50)
* 03 filler pic x.
03 fonction pic x(50).
* 03 filler pic x.
03 telephone-prof-bureau pic x(50).
* 03 filler pic x.
03 telephone-prof-mobile pic x(50).
* 03 filler pic x.
03 e-mail pic x(50) |
je fais :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| unstring repert-input delimited by "," into
societe of buffer-in
departement of buffer-in
salarie of buffer-in
fonction of buffer-in
telephone-prof-bureau of buffer-in
telephone-prof-mobile of buffer-in
e-mail of buffer-in.
display "societe of buffer-in = " societe of buffer-in.
display "department of buffer-in = " departement of buffer-in.
display "salarie of buffer-in = " salarie of buffer-in.
display "fonction of buffer-in = " fonction of buffer-in.
display "telephone-prof-bureau of buffer-in = "
telephone-prof-bureau of buffer-in.
display "telephone-prof-mobile of buffer-in = "
telephone-prof-mobile of buffer-in.
display "e-mail of buffer-in = " e-mail of buffer-in. |
Résultats 1er record:
"societe" = societe
"departement" = departement
"salarie" = nom prenom
"fonction"= fonction
"tel bureau" = tel bureu
"tel mobile" = tel mobile
"e-mail" = email
le premier record est donc OK
2eme record :
"societe" = d
"departement" =
"salarie" =
"fonction"=
"tel bureau" = e-mail
"tel mobile" = departement
"e-mail" = nom prenom
Pas OK
3eme record :
"societe" = a Imad A
"departement" =
"salarie" =
"fonction"=
"tel bureau" = e-mail
"tel mobile" = departement
"e-mail" = nom prenom
Pas OK
4eme record :
"societe" = societe
"departement" = departement
"salarie" = nom prenom
"fonction"= fonction
"tel bureau" = tel bureu
"tel mobile" = tel mobile
"e-mail" = email
C'est OK
5eme record :
"societe" = societe
"departement" = departement
"salarie" = nom prenom
"fonction"= fonction
"tel bureau" = tel bureu
"tel mobile" = tel mobile
"e-mail" = email
C'est OK
6eme record :
"societe" = departement
"departement" = nom prenom
"salarie" =
"fonction"=
"tel bureau" =
"tel mobile" = e-mail
"e-mail" = departement
pas OK
7eme record :
"societe" = nom prenom
"departement" =
"salarie" =
"fonction"=
"tel bureau" = e-mail
"tel mobile" = departement
"e-mail" = nom prenom
8eme record :
"societe" = email d'1 autre record
"departement" = departement OK
"salarie" = nom prenom OK
"fonction"= pas de données pour ce champs
"tel bureau" = pas de données pour ce champs
"tel mobile" = l pas de données pour ce champs
"e-mail" = e-mail OK
OK à part 1er champs décalé
9eme record :
"societe" = societe Ok mais nom de société est coupé
"departement" = departement
"salarie" = nom prenom
"fonction"= fonction
"tel bureau" = tel bureu
"tel mobile" = tel mobile
"e-mail" = email
10 eme record :
"societe" = societe
"departement" = departement
"salarie" = nom prenom
"fonction"= fonction
"tel bureau" = tel bureu
"tel mobile" = tel mobile
"e-mail" = email
OK mais 1er champs société un petit peu coupé car manque 3 lettres séparé par un blanc du reste du mot.
Donc ca décale encore sauf quelques fois les records sont plsu ou moins bons
il y a des coupures au milieu des mots et les mots composés séparée par un blanc
or mon ustring sépare les données délimitées par des ","
je devrais peut etre essayer de faire les unstring vers des zones élémentaires déclarées en 77 ?
Partager