Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy File Type SDF and Change Field Lengths?
Message
From
05/12/2005 16:59:31
 
 
To
05/12/2005 15:29:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01075080
Message ID:
01075128
Views:
15
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform