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     How do you issue a Filedef with maintain

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How do you issue a Filedef with maintain
 Login/Join
 
Gold member
posted
I am trying to use fixed format flat file to update the Movies sample focus database using maintain. I created a fixed format flat file called moviesdump and I am now trying to update the movies sample focus database with this data. Here is the code in the maintain file:

=========== start of MoviesUpdt.mnt =============

FILEDEF moviesdump DISK C:\IBI\APPS\JKDEMO\moviesdump.ftm

-RUN
MAINTAIN FILE Movies AND moviesdump
FOR ALL NEXT moviesdump.MovieCode INTO FilmStack;
FOR ALL INCLUDE Movies.MovieCode FROM FilmStack;
END

=============== end of MoviesUpdt.mnt ===========

When I run this code I get the following error message:

(FOC1006) THE DDNAME REQUESTED IS NOT ALLOCATED OR DLBL'ED :
�3�


What is the proper way of allocating the input flat file for the maintain procedure?
 
Posts: 62 | Location: New York City | Registered: December 29, 2004Report This Post
Virtuoso
posted Hide Post
[revised]

"I created a fixed format flat file called moviesdump ..."

- but did you also create a matching moviesdump.mas file?

Insert
? FILEDEF
?FF moviesdump

to see what Maintain sees.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Yes I did create a master. The master is as follows:

FILE=MOVIESDUMP ,SUFFIX=FIX
SEGNAME=MOVIESDU,SEGTYPE=S0
FIELDNAME =MOVIECODE ,E01 ,A6 ,A06 ,$
FIELDNAME =TITLE ,E02 ,A39 ,A39 ,$
FIELDNAME =CATEGORY ,E03 ,A8 ,A08 ,$
FIELDNAME =DIRECTOR ,E04 ,A17 ,A17 ,$
FIELDNAME =RATING ,E05 ,A4 ,A04 ,$
FIELDNAME =RELDATE ,E06 ,YMD ,A06 ,$
FIELDNAME =WHOLESALEPR ,E07 ,F6.2 ,A06 ,$
FIELDNAME =LISTPR ,E08 ,F6.2 ,A06 ,$
FIELDNAME =COPIES ,E09 ,I3 ,A03 ,$

I had WebFOCUS create this itself, by first tabling off Movies and including the following statement:
ON TABLE HOLD AS MOVIESDUMP FORMAT ALPHA

I then opened MOVIESDUMP.FTM in an editor, deleted all but one record, and modified the remaining record. Then I attempted to use MOVIESDUMP.FTM as an input file into the maintain procedure, when I got the FILEDEF error message. I added the FILEDEF code to the beginning of the maintain procedure, but WebFOCUS does not seem to be able to understand it. So I don't understand how you can use maintain with a flat file update file.
 
Posts: 62 | Location: New York City | Registered: December 29, 2004Report This Post
Virtuoso
posted Hide Post

  • what did the ? commands show?
  • does it work with a short filename (up to 8 chars) instead of moviesdump?
  • does it work if you place the TABLE ... HOLD in the same fex, ahead of the maintain?
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
I had some success, in that I got the maintain update to work through two methods, but I believe either method is clumsy.

The first success was accomplished by including in one fex two steps. In the first step I did a table request with the output being held in a alpha format hold file. This alpha format hold file was then accepted by the second step, which was the maintain step. All this occured within a single fex.

The second method, was to Filedef the input file (for the maintain) in the EDASPROF.PRF file. Then when the maintain procedure was run, it was able to read the input file. In this case, the input file was created though a separate process.

Rather than using these approaches, I would prefer to use a simpler method, where I update a FOCUS file through a simple flat file. This flat file could be coming from another process, which may or may not be FOCUS. I also would like to avoid updating the EDASPROF.PDF everytime I choose to use a flat file as input into maintain.

In the old days, when I used MODIFY, a user could update a FOCUS file using any flat file, by simply FILDEFing the input file and if necessary, describing the file layout of the incoming data.

That method, did not required modifying EDASPROF.PRF, or the creation of a temporary hold file in the same modify fex.

Does the maintain facility have a similar simple feature for updating using a simple flat file?
 
Posts: 62 | Location: New York City | Registered: December 29, 2004Report This Post
Virtuoso
posted Hide Post
If the input file is not HUGE (you are slurping the entire file into a stack), I suggest you let TABLE read and HOLD it, and then have Maintain use the HOLD output. That way if there is a problem accessing the data the error messages will come from good-old Table, so they will be more informative, or at least more familiar (and searchable in techsupport).

If large, at least have table read and SAVE some input transactions (under a record-limit) to a throw-away ddname, so you can verify access to the dataset and its mfd before getting into Maintain.

Also - Did you verify whether using short filenames makes a difference, as I suggested earlier? There used to be an 8-char limit in FILEDEF and MAINTAIN (a legacy of VM and MVS), so that's where the instability may lie.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
I have determined what the problem has been with reading a flat file into maintain.

I have been using the following code:

FILEDEF SHORTFD DISK C:\IBI\APPS\JKDEMO\FILMDATA.FTM
-RUN
MAINTAIN FILE Movies AND shortfd
FOR ALL NEXT shortfd.MovieCode INTO FilmStack;
FOR ALL INCLUDE Movies.MovieCode FROM FilmStack;
END

Since this is a "Maintain" procedure, I created it with a filetype of ".mnt". Then I would executed in Developer Studio from the maintain folder. Apparently, the "engine" that WebFOCUS runs for a ".mnt" procedure has trouble understanding what a Filedef is, and I get errors.

But if I rename the same procedure, with a suffix of ".FEX", it becomes an ordinary FEX which happens to contain a "Maintain" step. The "engine" that WebFOCUS uses for a "FEX" has no problem understanding the Filedef, and the procedure works properly.

So by including the maintain procedure in a fex, there is no need for either updating the EDASPROF.prf file, or including the TABLE and ON TABLE HOLD AS ALPHA step in the procedure.

I suspect that maintain procedures need to have a filetype of ".mnt" only if it includes a form. For batch processing, where the input is a flat file, then the filetype can be ".fex'.

Jack, thank you for your assistance.
 
Posts: 62 | Location: New York City | Registered: December 29, 2004Report This Post
Master
posted Hide Post
John
Just to confirm what you already figured out. The true solution to FILEDEF is to place the command in the EDASPROF. The MNT files can ONLY have Maintain commands. Anything that precedes the word Maintain or follows the word END is either ignored or will give an error.

If you just have a FEX, then you can get away with more and have Dialogue Manager and other commands in the same FOCEXEC.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
<LostinLife>
posted
I was using a different platform � Web Focus 5.2.6 we got the same error. The format was a VSAM file and to resolve I DYNAM ALLOC the VSAM file to my profile. Restarted Developer Studio and it worked. Hope this information helped.

Eeker
 
Report 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     How do you issue a Filedef with maintain

Copyright © 1996-2020 Information Builders