Silver Member
| 1) NEW Indicates that the data source has yet to be created.
2) I've had issues with REBUILD so I do it the tried and tested way...... Not that easy I'm afraid, you can sometimes get away with adding a field to end of a particular segment - but it is not recommended (so long as it does not exceed the 4K page limit).
i) You could dump each segment of the data into 1 hold file per segment making sure the hold files are permanently catalogued (just in case something goes wrong)
ii) Then change your master file desciption.
iii) issue your use
iv) issue your create file statement
v) Reload the data segment by segment
------------------------------------------- So for example if your master looks like:
FILE=MYFILE, SUFFIX=FOC SEGNAME=ROOT_SEG, SEGTYPE=S2, $ FIELD=FIELD1, ALIAS=FIELD1, FORMAT=A8, INDEX=I, $ FIELD=FIELD2, ALIAS=FIELD2, FORMAT=A20 , $ FIELD=FIELD3, ALIAS=FIELD3, FORMAT=I3 , $ $ SEGNAME=CHILD1, SEGTYPE=S1, PARENT=ROOT_SEG, $ FIELD=FIELD4, ALIAS=FIELD4, FORMAT=I9, INDEX=I, $ FIELD=FIELD5, ALIAS=FIELD5, FORMAT=A9, INDEX=I, $ $ SEGNAME=CHILD2, SEGTYPE=S1, PARENT=CHILD1, $ FIELD=FIELD6, ALIAS=FIELD6, FORMAT=I5, INDEX=I, $ FIELD=FIELD7, ALIAS=FIELD7, FORMAT=A5, INDEX=I, $
-********************************************************* -* FEX TO DUMP DATA SEG BY SEG -* NOTE THE 'BY' SEQUENCES ECHO THE KEYS IUN THE DATABASE -* SO TO FULLY QUALIFY THE CONTENTS OF FIELD7 -* YOU NEED TO KNOW FIELD1 & FIELD2 (S2 SEG) -* YOU NEED TO KNOW FIELD4 (S1 SEG) -* YOU NEED TO KNOW FIELD6 (S1 SEG) -********************************************************* FILEDEF DUMPSEG01 DISK &APPROOT..\MYAPP\DUMPSEG01.FTM FILEDEF DUMPSEG02 DISK &APPROOT..\MYAPP\DUMPSEG02.FTM FILEDEF DUMPSEG03 DISK &APPROOT..\MYAPP\DUMPSEG03.FTM
TABLE FILE MYFILE PRINT FIELD3 BY FIELD1 BY FIELD2 ON TABLE HOLD AS DUMPSEG01 FORMAT ALPHA END
TABLE FILE MYFILE PRINT FIELD5 BY FIELD1 BY FIELD2 BY FIELD4 ON TABLE HOLD AS DUMPSEG02 FORMAT ALPHA END
TABLE FILE MYFILE PRINT FIELD7 BY FIELD1 BY FIELD2 BY FIELD4 BY FIELD6 ON TABLE HOLD AS DUMPSEG03 FORMAT ALPHA END
DOS COPY DUMPSEG*.MAS &APPROOT..\MYAPP\DUMPSEG.MAS
-********************************************************** -* NOW CREATE YOU NEW MASTER FILE -********************************************************** FILE=MYFILE, SUFFIX=FOC SEGNAME=ROOT_SEG, SEGTYPE=S2, $ FIELD=FIELD1, ALIAS=FIELD1, FORMAT=A8, INDEX=I, $ FIELD=FIELD2, ALIAS=FIELD2, FORMAT=A20 , $ FIELD=FIELD3, ALIAS=FIELD3, FORMAT=I3 , $ $ SEGNAME=CHILD1, SEGTYPE=S1, PARENT=ROOT_SEG, $ FIELD=FIELD4, ALIAS=FIELD4, FORMAT=I9, INDEX=I, $ FIELD=FIELD5, ALIAS=FIELD5, FORMAT=A9, INDEX=I, $ $ SEGNAME=CHILD2, SEGTYPE=S1, PARENT=CHILD1, $ FIELD=FIELD6, ALIAS=FIELD6, FORMAT=I5, INDEX=I, $ FIELD=FIELD7, ALIAS=FIELD7, FORMAT=A5, INDEX=I, $ FIELD=FIELDX, ALIAS=FIELDX, FORMAT=A5, INDEX=I, $ -*********************************************************** -* NOW ISSUE CREATE AND USE FOR FOCUS DB -*********************************************************** FILEDEF DUMPSEG01 DISK &APPROOT..\MYAPP\DUMPSEG01.FTM FILEDEF DUMPSEG02 DISK &APPROOT..\MYAPP\DUMPSEG02.FTM FILEDEF DUMPSEG03 DISK &APPROOT..\MYAPP\DUMPSEG03.FTM
USE D:\IBI\APPS\MYAPPS\MYFILE.FOC NEW END
CREATE FILE MYFILE -RUN -*********************************************************** -* SEG 1 LOAD -*********************************************************** MODIFY FILE MYFILE FIXFORM FROM DUMPSEG01 DATA ON DUMPSEG01 END
-*********************************************************** -* SEG 2 LOAD -*********************************************************** MODIFY FILE MYFILE FIXFORM FROM DUMPSEG02 DATA ON DUMPSEG02 -* MATCH FIELD1 ON MATCH REJECT ON NOMATCH CONTINUE -* MATCH FIELD4 ON MATCH REJECT ON NOMATCH INCLUDE END
-*********************************************************** -* SEG 3 LOAD -*********************************************************** MODIFY FILE MYFILE FIXFORM FROM DUMPSEG03 DATA ON DUMPSEG03 -* MATCH FIELD1 ON MATCH REJECT ON NOMATCH CONTINUE -* MATCH FIELD4 ON MATCH REJECT ON NOMATCH CONTINUE -* MATCH FIELD6 ON MATCH REJECT ON NOMATCH INCLUDE END
-************************************************************ -*NOW YOU CAN POPULATE FIELDX SAFELY -************************************************************
GOOD LUCK P |