Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] REBUILD/INDEX Issue.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] REBUILD/INDEX Issue.
 Login/Join
 
Member
posted
FOCUS Version 7.6.5
System MVS P390
Batch Processing

Hi,

I'm getting an error message in process of using of the REBUILD/INDEX to index one field in a data file.

The error message I'm getting is:"FIELDTYPE OF FIELD NAMED FIELD3 IS NOT I".

The reason I use REBUILD/INDEX to index a field within a file is to speed-up the indexing process. The file I'm indexing is more than 300,000 records and is taking hours to get indexed when indexing using the regular FOCUS approach such as "ON TABLE HOLD AS FILE1 FORMAT FOCUS INDEX FIELD1".

The way I use REBUILD/INDEX is as follows:
1.
DYNAM FREE DDNAME FILEOUT

DYNAM ALLOC DDNAME FILEOUT -
DA FILEOUT.TXT -
NEW CATLG -
UNIT SYSDA -
SPACE 10,10 CYLINDER RELEASE
2.
TABLE FILE FILE0
PRINT
FIELD1
FIELD2
BY FIELD3
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS FILEIND FORMAT FOCUS INDEX FIELD3
END

3.
TABLE FILE FILE0
PRINT
FIELD1
FIELD2
BY FIELD3
ON TABLE HOLD AS FILEOUT
END

4.
DYNAM FREE FILE FILEIND
DYNAM ALLOC FILE FILEIND DS FILEOUT.TXT SHR REUSE

5.
DYNAM FREE FILE SORTIN
DYNAM FREE FILE SYSOUT
DYNAM FREE FILE SORTOUT
DYNAM FREE FILE SORTWK01
DYNAM FREE FILE SORTWK02
DYNAM FREE FILE SORTWK03
DYNAM ALLOC FILE SORTIN SPACE 50,10 CYL NEW
DYNAM ALLOC FILE SORTOUT SPACE 50,10 CYL NEW
DYNAM ALLOC FILE SORTWK01 SPACE 50,10 CYL NEW
DYNAM ALLOC FILE SORTWK02 SPACE 50,10 CYL NEW
DYNAM ALLOC FILE SORTWK03 SPACE 50,10 CYL NEW

6.
REBUILD
INDEX
FILEIND
FIELD3 <-----------“ FIELDTYPE OF FIELD NAMED FIELD3 IS NOT I”

I don’t know what is the issue with above stated code? The masterfile does show that FIELD3 has “FIELDTYPE” of an “I”.


Any help is greatly appreciated.

Thank you,
Alaga

This message has been edited. Last edited by: Kerry,
 
Posts: 9 | Registered: June 04, 2007Report This Post
Expert
posted Hide Post
There is a technique that is recommended for loading large FOCUS files and then indexing them later.

1. Create two masters, one with and one without indexes.
2. Do a CREATE FILE on the master WITH the index.
3. Swap the masters.
4. Load the file using MODIFY using the master without indexes. So, in your step 2:
CREATE FILE FILEING
TABLE FILE FILE0
PRINT
FIELD1
FIELD2
BY FIELD3
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS FILEHOLD
END
MODIFY FILE FILEIND
FIXFORM FROM HOLD
DATA ON HOLD
END

5. Now swap the masters again.
6. Do the REBUILD/INDEX.

Please let me know if you need any clarification. There's a lot of moving and renaming going on but this is a tried-and-true technique. The CREATE FILE is critical to success.


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
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
Hi Ginny,

I tried to follow the instruction you have provided and couldn't get it done. Would you mind adjusting my code I provided in the original post to include your suggestions.

Also, if you know of an IBI article outlining what you explained in your response please forward me the link to it.

Thank you for all your help on this. It is greatly appreciated.

Alaga
 
Posts: 9 | Registered: June 04, 2007Report This Post
Expert
posted Hide Post
This might be useful:http://techsupport.information...cof/cof_tcn_018.html
I'll not modify your code as it is a better learning situation if you do it yourself. However, I will provide an example from our Unix system.

Here is the no index master (I will leave out a bunch of the fields):
FILE=MPVELSUM, SUFFIX=FOC     ,
DATASET=/data/bnsf/mp/mpvelsum.foc
SEGNAME=MPVELSUM, SEGTYPE=S0 ,$
FIELD=E_DATE   ,ALIAS=E_DATE,   FORMAT=A10         ,MISSING=ON ,$
FIELD=EDATE    ,ALIAS=EDATE,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=HP       ,ALIAS=HP,       FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MILES    ,ALIAS=MILES,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MEASTM   ,ALIAS=MEASTM,   FORMAT=D20.2       ,MISSING=ON ,$

Here is the indexed master:
FILE=MPVELSUM, SUFFIX=FOC     ,
DATASET=/data/bnsf/mp/mpvelsum.foc
SEGNAME=MPVELSUM, SEGTYPE=S0 ,$
FIELD=E_DATE   ,ALIAS=E_DATE,   FORMAT=A10         ,MISSING=ON ,INDEX=I,$
FIELD=EDATE    ,ALIAS=EDATE,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=HP       ,ALIAS=HP,       FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MILES    ,ALIAS=MILES,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MEASTM   ,ALIAS=MEASTM,   FORMAT=D20.2       ,MISSING=ON ,$
FIELD=UTLTM    ,ALIAS=UTLTM,    FORMAT=D20.2       ,MISSING=ON ,$

Notice that they both point to the same data base. You will not need the DATASET parameter as you will use the DYNAM command.
You will need a 3rd master which is the one that is named the same as your file:
FILE=MPVELSUM, SUFFIX=FOC     ,
DATASET=/data/bnsf/mp/mpvelsum.foc
SEGNAME=MPVELSUM, SEGTYPE=S0 ,$
FIELD=E_DATE   ,ALIAS=E_DATE,   FORMAT=A10         ,MISSING=ON ,INDEX=I,$
FIELD=EDATE    ,ALIAS=EDATE,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=HP       ,ALIAS=HP,       FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MILES    ,ALIAS=MILES,    FORMAT=D20.2       ,MISSING=ON ,$
FIELD=MEASTM   ,ALIAS=MEASTM,   FORMAT=D20.2       ,MISSING=ON ,$
FIELD=UTLTM    ,ALIAS=UTLTM,    FORMAT=D20.2       ,MISSING=ON ,$

Next there is a TABLE request to extract the data and put it in a hold file. I already showed that in my previous post. Here is the rest with annotation:
SET MESSAGE=OFF
SET REBUILDMSG = 0
TABLE FILE MPSAS_LOCO_VELOC_SMRY
PRINT
 EDATE
 HP
 MILES
 MEASTM
 UTLTM
...
BY E_DATE
WHERE E_DATE GE whatever'
ON TABLE HOLD FORMAT ALPHA
END
-* Create the file with the master with indexes.  This will leave a slot for the index in the root page of the DB.
CREATE FILE MPVELSUM
-* You may have to use DYNAM COPY to do this and the one below.
-* Copy the no index master to the true master.
APP COPYFILE mp_loco mpvelsum_noix MASTER mp_loco mpvelsum MASTER
-* Load the file with the no index master.
MODIFY FILE MPVELSUM
FIXFORM FROM HOLD
DATA ON HOLD
CHECK 5000
END
-RUN
-* Copy the index master to the true master
APP COPYFILE mp_loco mpvelsum_indx MASTER mp_loco mpvelsum MASTER
-* Do the REBUILD/INDEX
REBUILD
INDEX
MPVELSUM
*
-RUN

You may also need to use a USE statement to refer the master to the data base. You can look up that command.

Hope this helps.


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
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Member
posted Hide Post
Thank you so much Ginny. This will work.

Alaga
 
Posts: 9 | Registered: June 04, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] REBUILD/INDEX Issue.

Copyright © 1996-2020 Information Builders