Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change field format in master file

Status
Not open for further replies.

H1004

MIS
Oct 28, 2003
136
US
I have a history FOCUS file save in the F drive, which I tend to use every quarter for history reporting. However, this quarter, one of the field got bigger, so now I have to change the master file to reflect the change. But if I change my old HIST master file, then the HIST focus file won't work. So whenever I run the HIST focus file, it gave me no data. Is there a way to solve this.
 
Where is the data coming from? Is there a job that loads a FOC file or does the data get input into FOCUS directly? If changing the length of the fields causes a problem with the FOCUS file, then you'll need to do a REBUILD REORG on it.
 
The data in the FOC file is coming from the History.fex that I run quarterly. Basically every quarter, I run history.fex which get the current quarter data & add the old data in the old history foc and save it into a new history foc file which then overwrite the old one. Does it makes sense?
And what is REBUILD REORG? I'm not familiar with it! I couldn't find it in the reference book neither?
 
You could TABLE the original history file, reformatting the column in question to the new size, and hold the output.

TABLE the new data appending it to the history output.

Then TABLE the hold file holding it format focus with the new format.

eg

TABLE FILE HISTORY
PRINT COST/D15.2
BY CAR
ON TABLE HOLD AS TEMPHIST
END
-RUN

FILEDEF TEMPHIST DISK ./temphist.ftm (APPEND
-RUN

TABLE FILE NEWDATA
PRINT COST
BY CAR
ON TABLE HOLD AS TEMPHIST
END
-RUN

TABLE FILE TEMPHIST
PRINT COST
BY CAR
ON TABLE HOLD AS NEWHIST FORMAT FOCUS
END
-RUN
 
There are TWO considerations here, depending on whether
the file is a FOCUS file (SUFFIX=FOC in MFD), or an external file?

1. If a Focus file, then, within limits, you can expand the display format, without affecting the storage layout. for example, you can expand a D10 to a D12, and NOT change the data, as, internally, all D fields take 8 bytes of storage.

2. If NOT a Focus file (SUFFIX is NOT FOC), then did the ACTUAL format change? If not, then see rule 1 above. If the ACTUAL DID change (more bytes needed to store the values on the external record), then you can either CHANGE the layout for past data (as mentioned by others)by dumping and reloading, or use a different MFD for the new data, and use the MORE command, to merge old and new data together, when needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top