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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
FILEDEF
 Login/Join
 
Gold member
posted
Can any one explain me clearly the function of FILEDEF and DYNAMALLOC commands?
 
Posts: 76 | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
FILEDEF mastername DISK completepathdata
FILEDEF MYFILE DISK D:\IBI\APPS\MYDATA.FTM
In this case, MYFILE is the name of the master file description, which must be somewhere in the EDAPATH.
MYDATA is a file that is NOT a focus file, in this case, the .FTM extension indicates that it is a foctemp file. It could be .TXT, .csv etc.
This FILEDEF statement allows you to read the
file called MYDATA, wherever it is, using the master file description MYFILE.
Most commonly, the data file and the master file have the same name, especially when you're using focus to create them....
So, to write out a file, that is not focus file
you'll need to do 1 more thing, that is tell focus not only where the data file is to go, but also where you want the master file to go.
so you add
FILEDEF HOLDMAST DIR completepath
FILEDEF HOLDMAST DIR D:\IBI\APPS
will put a master of the same name as the file you create into the D:\ibi\apps directory.
For focus files, you don't use FILEDEF, you use USE statments to read them, but you also can use FILEDEF HOLDMAST when writing focus files to tell focus where to put the master.
USE
d:\ibi\apps\mydata.foc
END
will let you read the focus file (assuming the master is on the edapath)
USE
D:\ibi\apps\mydata.foc new
END
will let you write the focus file, and
FILEDEF HOLDMAST DISK D:\IBI\APPS
will allow the master MYDATA.MAS to be put into the same directory.
I'll let someone else come along and do DYNAM for you.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
All of the metadata files, like Master files,
and Access files, and Focexecs, are in special
directory names that are the same on all machines.
This is the APP directory under the root where you located WebFocus. BUT, data may exist anywhere, and the FILEDEF command (general files), and DYNAM, command (MVS), and USE command (Focus files) just tell WebFocus where the data is.
Of course, if the data is in a RDBMS, then its location is already stored in the ACCESS file and you should not have to do anything.
 
Posts: 226 | Registered: June 08, 2003Report This Post
Gold member
posted Hide Post
Hello Susannah and Gerald,

Thank you for explaining me the function of FILEDEF command. I kind of understood what it does. I have a procedure that has FILEDEF command, I am not able to figure how it is working.
For example my code is like this:

FILEDEF PIM DISK /home/mp6312/pim.fex
TABLE FIEL xxx
....

....
ON TABLE HOLD AS HOLD5
end

DEFINE FILE HOLD5
TYPE/A1=DECODE TQDS_CODE(PIM ELSE '$');
END

From my understanding of FILEDEF command PIM is the procedure name and it is stored in a home directory of someone(I know that mp6312 is account for some person).
Then we are using that procedure in DECODE command.
I thought DECODE command should have this format:
DECODE FILE HOLD5
TYPE/A1 = DECODE FIELDNAME(CODE RESULT1 ESLE RESULT2);

I did not understand why they have used IOC here.
How can we know what is stored in IOC?

Any suggestions?
 
Posts: 76 | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
your file PIM in this case appears not to be operating as a procedure, but rather as a flat file whose extension happens to be .fex.
the content of the file is most likely two columns of data, looking just like a long DECODE statement. The first column is the entry value corresponding to the values of TQDS_CODE and then there is probably a blank space and then the value that you want to place into the field you call TYPE. This method of using a FILE for your decodes is a cool way of not having to type in all the decode values. See if you can take a look at the PIM file itself, then it will be clear.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
I'm still having issues with this topic since I'm trying to create a report that will create one .ftm file or .dat file then in the same program, run another report and append to the previous file.

I am just wondering if there needs to be some sort of rights given since I keep getting a "error opening file" after I've declared my FILEDEF's and ran the program. Again, I'm on Webfocus 5.3.

Thanks!

This message has been edited. Last edited by: gregson06,
 
Posts: 87 | Registered: August 03, 2006Report This Post
Expert
posted Hide Post
for appending one flat to another, use
FILEDEF PIM DISK ..whereever it is
TABLE FILE CAR
PRINT *
ON TABLE HOLD AS PIM
END
FILEDEF PIM DISK ...whereever it is (APPEND
TABLE FILE CAR
PRINT *
ON TABLE HOLD AS PIM
END
..and you'll see that the APPEND command , issued after the output file was first populated will just attach the new records to the bottom of the existing record set.
Look up APPEND or FILEDEF APPEND and see what you come up with.

if you're creating your file from scratch( as i seem to think you're saying), then make sure you have write permission to the destination where you're parking this file.
to just park the file inside the agent you're working it,
FILEDEF PIM DISK PIM.TXT
write someting to it.
FILEDEF PIM DISK PIM.TXT (APPEND
write something more to it
now read it
TABLE FILE PIM PRINT *
END
and you'll prove to yourself that you can do it.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders