Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy File Type SDF and Change Field Lengths?
Message
De
05/12/2005 17:06:55
 
 
À
05/12/2005 16:59:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01075080
Message ID:
01075130
Vues:
14
I tried that myself Fabio to no avail. It drops the two fields that use CAST() completely. No error, but the resultant file is missing those two fields.



>>I have a tabled named reinreq with the below fields (see end of this message for full structure):
>>
>>account n(20,0)
>>name c(25)
>>policy c(25)
>>
>>etc (more fields)...
>>
>>Currently we create a transfer txt file using:
>>
>>
>>SET FIELDS TO AGENT_CODE, AGENT_CSR, ACCOUNT, NAME,;
>>	POLICY, CO_CONTACT, AMOUNTPAID, FAX_MAIL,;
>>	COMMENTS, REC_DATE, REC_NUM, REC_TYPE,;
>>	DATE_ENTER
>>GO TOP
>>IF !EOF()
>>	COPY TO (m_filename) TYPE SDF
>>ENDIF
>>
>>The file is sent to an https site and readin to an AS400 system.
>>
>>However, I need to limit the account field to 9 characters and the policy field to 14 characters. All the other fields should stay the same as the table's field layout. Is there a simple way to do this?
>>
>>Structure for table:    C:\PROFILER\DATA\REINREQ.DBF
>>Number of data records: 1
>>Date of last update:    12/02/2005
>>Code Page:              437
>>Field  Field Name      Type                Width    Dec   Index   Collate Nulls    Next    Step
>>    1  AGENT_CODE      Numeric                 6                             No
>>    2  AGENT_CSR       Character              15                             No
>>    3  ACCOUNT         Numeric                20                             No
>>    4  NAME            Character              25                             No
>>    5  POLICY          Character              25                             No
>>    6  CO_CONTACT      Character              25                             No
>>    7  AMOUNTPAID      Numeric                 9      2                      No
>>    8  FAX_MAIL        Character               1                             No
>>    9  COMMENTS        Character              55                             No
>>   10  REC_DATE        Date                    8                             No
>>   11  REC_NUM         Numeric                 9                             No
>>   12  REC_TYPE        Character               1                             No
>>   13  DATE_ENTER      Date                    8                             No
>>   14  DATE_SENT       Date                    8                             No
>>   15  TIME_SENT       Character               5                             No
>>   16  PO_DETAIL       Numeric                 8            Asc   Machine    No
>>   17  PO_SYSNUM       Numeric                 8                             No
>>   18  MINDUE          Numeric                 9      2                      No
>>** Total **                                  246
>>
>
>
>LOCATE
>IF FOUND()
>	SET FIELDS GLOBAL
>	SET FIELDS TO AGENT_CODE, AGENT_CSR, ACCOUNT=CAST(ACCOUNT AS C(9)), NAME,;
>		POLICY=CAST(POLICY AS C(14)), CO_CONTACT, AMOUNTPAID, FAX_MAIL,;
>		COMMENTS, REC_DATE, REC_NUM, REC_TYPE, ;
>		DATE_ENTER
>	COPY TO (m.m_filename) TYPE SDF
>	SET FIELDS TO
>ENDIF
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform