Focal Point
Returning data to calling procedure

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

March 18, 2008, 07:42 PM
MacLonghorn
Returning data to calling procedure
I have a proc I use in several places that creates a file called MYOWG (via HOLD). If I want to use this in other, calling procedures, what's the best way to do this? HOLD? SAVE? I have a multiuser environment, so if I use a FILEDEF, won't that file be overwritten when the 2nd user calls the proc? Should I use -INCLUDE or EXEC proc?

Thanks.


Thanks.

Mark
WF 7.6 Windows
March 19, 2008, 11:29 AM
Darin Lee
So are you wanting everyone who runs this procedure to have their own copy of MYOWG?

As for -INCLUDE vs. EXEC, they both do basically the same thing, but -INCLUDE is a little easier if you're passing parameters, easier for troubleshooting because you can see the -INCLUDED code. Also, I think that EXEC opens an additional agent, but I may be mistaken on that.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 19, 2008, 11:48 AM
MacLonghorn
Yes, essentially, I want the called proc (procB) to return a bunch of data that can be used by multiple calling procedures (probA). Problem seems to be that if procB HOLDs or SAVEs the data, it's not accessible by procA. Or is there a way to do this?

My thought at this point is to define a HOLD (MYOWG) in calling procedure procA with the structure I need, then have called proc procB do a TABLE FILE MYOWG MORE FILE ...

Should that work? Is that the best way to do that, or is there another way?

>>>>>
I have since figured this out...mainly due to my ignorance. I think I misunderstood what a FILEDEF does. What I have done now is created a Focus SYNONYM that I can use for holding the data. Now both procs can access that structure.

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


Thanks.

Mark
WF 7.6 Windows
March 20, 2008, 10:31 AM
Diptesh Patel
Why not use a FILEDEF to SAVE to a location with a unique identifier for the filename? Something like a combination of userid and timestamp will normally make it a unique filename. Of course, you then have to worry about cleanup also, otherwise the number of files will get out of hand.


Diptesh
WF 7.1.7 - AIX, MVS