Focal Point
[SOLVED] REORG issue: adding a field as part of index

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/732105361

June 26, 2009, 09:23 AM
Remya
[SOLVED] REORG issue: adding a field as part of index
Hi,

I want to include an existing field as part of index of a segment in a database. Master of the database file looks shown below:

FILENAME=database,SUFFIX=FOC
SEGNAME=segment1,SEGTYPE=S1,$
FIELD=field1 , , A13 ,INDEX=I,$
FIELD=field2 , , A4 , $
FIELD=field3 , , A1 , $
FIELD=field4 , , A2 , $
FIELD=field5 , , A1 ,$
FIELD=field6 , , A1 ,$
FIELD=field7 , , A1 ,$
FIELD=field8 , , A2 ,$
FIELD=field9 , , A2 ,$

Now i want to make field3 a part of index with field1,so i changed the master layout as shown below:


FILENAME=database,SUFFIX=FOC
SEGNAME=segment1,SEGTYPE=S2,$
FIELD=field1 , , A13 ,INDEX=I,$
FIELD=field3 , , A1 , $
FIELD=field2 , , A4 , $
FIELD=field4 , , A2 , $
FIELD=field5 , , A1 ,$
FIELD=field6 , , A1 ,$
FIELD=field7 , , A1 ,$
FIELD=field8 , , A2 ,$
FIELD=field9 , , A2 ,$

After making this change in the master, we ran a job to REORG the database.

//SK0676NK JOB (A11000-DV),'REORG',
// CLASS=P,MSGCLASS=E,
// NOTIFY=&SYSUID
.
.
.
.
//DATABASE DD DSN=DFK0B.HBOL.S062609.DATABASE,DISP=SHR
//SYSIN DD *

REBUILD
REORG
DUMP
DATABASE
NO

REBUILD
REORG
LOAD
DATABASE

FIN


After this we ran a TABLE FILE to print the segment1 which we changed (using the MASTER we changed) and it looks like REORG did not work. The data of field2 appears in field3 and viceversa i.e. the data hasn't moved.

Please let me know what we are doing wrong. Or rather let us know how to make an existing field, part of the index of a segment.

This message has been edited. Last edited by: Kerry,


FCOUS 7.6.1
Z/OS
use focus in report generaton as well as in online screens
June 26, 2009, 09:40 AM
GinnyJakes
Hopefully you made a backup of the original file. When you are moving fields around and creating indexes, you need two masters, the old one and the new one. When you run your rebuild, dump from the old master and load into the new one or do a rename of the masters inbetween.

Backing up the original is absolutely mandatory when performing these operations. If you did not make a backup then I suggest that you TABLE off the current version swapping the field contents. Then using your new master, reload the database with a simple modify. If the number of records is high, you might want to do a CREATE FILE with the master with indexes, do the MODIFY with a master without indexes, then do a REBUILD INDEX with the master with indexes.

Good luck.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
June 28, 2009, 05:30 PM
Waz
The other question here is do you want an extra Key field or another field to be indexed ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 29, 2009, 09:57 AM
Remya
Ginny, I had taken a backup of the databse before attempting the REORG.
Waz, It's is an existing filed of the database that we wanted to make as part of the key.

Well, I ran the REORG DUMP job with the DD REBUILD having DSN catalogued and old master and used this catalogued file in REORG LOAD job using new master. This time, it worked!! When I did a TABLE FILE on the databse, it printed the fields correctly.

Thanks Ginny and Waz.. Smiler


FCOUS 7.6.1
Z/OS
use focus in report generaton as well as in online screens