I am developing a procedure that picks up hold files created by different users in MRE. I am able to use GETUSER(USERID) to determine the user who is running this procedure. But I can't find a way to get the folder name of the HOLDDATA path of the user (we create private HOLDDATA folder for each user in user.prf profile). Is there a sys function like GETUSER can do this?
Thanks.This message has been edited. Last edited by: bug,
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
August 15, 2012, 03:05 PM
Francis Mariani
I don't know of a system function that provides that info, but perhaps you could use APP QUERY to list files within the folder.
APP MAP TEST1 "C:\IBI\SRV77\WFS"
APP QUERY TEST1 HOLD
TABLE FILE FOCAPPQ
PRINT
*
END
Documentation: Developing Reporting Applications > Managing Applications > Reports and Help
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
August 15, 2012, 04:17 PM
bug
Francis, thanks for your input.
The program does not know the HOLDDATA app name ("TEST1" in your example). Is there a way to retrieve the app name, or the physical folder name mapped to the app name? My ultimate goal is to get the physical folder name ("C:\IBI\serv77\wfs" in your example). It must be stored somewhere on the server, just don't know how to get it.
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
August 15, 2012, 05:26 PM
Francis Mariani
First, let's determine what
quote:
we create private HOLDDATA folder for each user in user.prf profile
means - you must know a higher-level directory...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
August 15, 2012, 06:01 PM
Severus.snape
Hi,
My thoughts here --since the app folder created at run time will be part of the approot- you can user APP LIST and check for the naming pattern of the user specific APP folder. Again it depends on the way the dynamic folder is being created --naming used and all.
thanks Sashanka
WF 7.7.03/Windows/HTML,PDF,EXL POC/local Dev Studio 7.7.03 & 7.6.11
August 16, 2012, 05:42 AM
Twanette
This could do with some cleaning up, but it may be what you're after.
As long as you know the name of a file that is in the directory, you can use FMI to get the physical file name. You can then strip out the name to get the actual directory name:
SQL FMI SET SYSFILES MASTER
TABLE FILE SYSFILES PRINT PHNAME
WHERE FILENAME EQ 'car';
ON TABLE HOLD AS TF
END
-RUN
-READFILE TF
-TYPE FILE NAME IS &PHNAME
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
August 16, 2012, 01:56 PM
Doug
Just an enhancement:
SQL FMI SET SYSFILES MASTER
TABLE FILE SYSFILES PRINT PHNAME
WHERE RECORDLIMIT EQ 12
ON TABLE HOLD AS TF
END
-RUN
-REPEAT ENDOFLOOP &LINES TIMES ;
-READ TF &PHNAME.A80.
-IF &PHNAME CONTAINS '&FindThis.EVAL' THEN GOTO DO_SOMETHING ELSE GOTO DO_NOTHING ;
-DO_SOMETHING
-TYPE Doing Something ... FILE NAME IS &PHNAME
-GOTO ENDOFLOOP
-DO_NOTHING
-TYPE Doing Nothing ..... FILE NAME IS &PHNAME
-GOTO ENDOFLOOP
-ENDOFLOOP
-* Do more...
the "WHERE RECORDLIMIT EQ 12" is just there for test/demo.
August 27, 2012, 10:41 AM
bug
Sorry for the late feed back. I was occupied in other issues in the the past week.
Twanette's code work perfectly for me. It's interesting that I can't find TEMPPATH() from the webfocus help file. I am wondering how many other system functions I am still not aware of
I appreciate everyone's input. This is a solved case. Thanks!
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)
August 27, 2012, 01:07 PM
Francis Mariani
The only documentation I've found that mentions TEMPPATH is the Stored Procedure Reference (v7.7.03), an interesting document, where among other things, you learn how to write a stored procedure in Dialogue Manager.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
August 31, 2012, 10:02 AM
bug
quote:
Originally posted by Francis Mariani: The only documentation I've found that mentions TEMPPATH is the Stored Procedure Reference (v7.7.03), an interesting document, where among other things, you learn how to write a stored procedure in Dialogue Manager.
Guess I have to update my help file library. Thanks Francis!
7.66 and 7.704 System: Windows / AIX / Linux Output: Mostly HTML, with some PDF, Excel and Lotus(!)