Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Appending data - problem
Message
De
05/10/1999 14:06:26
Jolene Dicks
Human Resources Development Canada
St. John's, Terre-Neuve, Canada
 
 
À
05/10/1999 13:17:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00272716
Message ID:
00272825
Vues:
27
I don't want to force the value of that field to be "0"'s. This is information that we receive from a third party that has to be merged with our database. I tried using PADL(Rendorin, 10), which will just return the value stored in that field, however once the data is appended from the tmpclaim table to the process table, it still remains blank.

Here is the exact code that I am using:

Use (Ddnldei+"V11481") IN 0
ZAP

** Data from two different pre-formatted text files are appended to the
** V11481.dbf.

If FILE(CDnldEI+"V11481.TXT")
Append From (CDnldEI+"V11481.TXT") Type SDF
Endif

Wait Window "EI - Adding Dormant EI Client to database file..." NoWait
If FILE(CDnldEI+"V11481D.TXT")
Append From (CDnldEI+"V11481D.TXT") Type SDF
Endif

** At this point the field I am talking about is called ren_dor_in, is numeric ** and has 0 as the value.

Wait Window "EI - Selecting EI data from database file..." NoWait
select sin, name, name as fname, name as lname, ;
address1, address2,address3,allt(str(prov)) as province,;
ctod(allt(str(birth_yyyy))+ "/" + allt(str(birth_mm)) + "/" +;
allt(str(birth_dd)) ) as dob, allt(str(language)) as language,;
left(postalcode,3)+right(postalcode,3) as postalcode,;
phonearea+allt(str(telephone)) as phoneno, sex_code as sex,;
allt(str(student)) as student, sub_office as rcno, ;
allt(str(occupation)) as occupation, dnrt_sbrn, allt(str(claimtype));
as claimtype, allt(str(claimstat)) as claimstat,bpc as bpc,;
allt(str(lwp)) as lwp,allt(str(fiw)) as fiw, allt(str(renewal)) as renewal,;
allt(str(revival)) as revival,ins_weeks,ins_earns,ben_rate,ben_to_dat,;
allt(str(ex_ben_reg)) as ex_ben_reg, allt(str(int_status)) as int_status, ;
agreed_ded, allt(str(work_share)) as work_share, allt(str(wli)) as wli,;
allt(str(sub)) as sub, allt(str(last_reprt)) as last_reprt,;
weeks_paid, op_owing, allt(str(ma1)) as ma1, allt(str(ma2)) as ma2,;
allt(str(ipr)) as ipr, allt(str(ftr_ind)) as ftr_ind, ;
ftaxrate, entitlemnt, allt(str(disqual_01)) as disqual_01,;
allt(str(disqual_02)) as disqual_02,allt(str(disqual_03)) as disqual_03,;
allt(str(disent_01)) as disent_01, allt(str(disent_02)) as disent_02,;
allt(str(disent_03)) as disent_03, allt(str(training)) as training, ins_hours,;
fben_rate,PADL(ren_dor_in,10) as rendorin, allt(str(dor_cnt)) as dor_cnt ;
from V11481 into table (Cdnldei+"TmpClaim")

** At this point, the TmpClaim.Rendorin field contains all 0's, but the field ** is CHAR(10).

select V11481
zap

Select tmpclaim
replace all fname with ThisFormSet.Einame(name,"F") + " " +ThisFormSet.einame(name,"M"), lname with ThisFormSet.einame(name,"L")

** At this point, all values are still "0"'s.
use (cdnldei + "process") in 0
Select Process
zap

append from (cdnldei + "tmpclaim")
** ONce this append is executed, the values are blank for the rendorin field.

Function EiName
Parameters expr, ret
expr = allt(expr)
middle = ""
last = ""
first = ""
Do Case
Case ret = "F" && looking for First Name
for x = 1 to len(expr)
If substr(expr,x,1 ) = " "
first = allt(left(expr,x))
return first
exit
Endif
next
return " "
Case ret = "M" && looking for Middle Initial
for x = 1 to len(expr)
If substr(expr,x,1 ) = " "
tmpstr = allt(right(expr,len(expr) - x) )
for i = 1 to len(tmpstr)
If substr(tmpstr,i,1 ) = " "
middle = left(tmpstr,i)
return middle
exit
Endif
next
exit
Endif
next
return " "
Case ret = "L" && looking for Last Name
for x = len(expr) to 1 step -1
If substr(expr,x,1 ) = " "
last = allt(right(expr,len(expr) - x))
return last
exit
Endif
next
return " "
Endcase


I provided all the code, cause there maybe something in there tripping me up. Any suggestions?????
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform