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.
hi everyone, this is my first post here but I'm working on Web Focus by about 2 year. I always wanted to create table with dynamic name but without great success... Now I need this and I can't avoid it in other way. I've searched in this forum for a solution, and I found many posts, but none works for me.
This is the code
-* &USERID is passed by a form
-SET &TABUSERID = 'TABUSER_' || &USERID;
-SET &IBI_FIL = '!IBI.FIL.' || &TABUSERID || ';';
TABLE FILE ADB_USER
PRINT NAME SURNAME
BY USERCODE NOPRINT
IF USERCODE EQ &USERID
ON TABLE HOLD AS &TABUSERID
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Title</title>
</head>
<body>
-* <!--WEBFOCUS TABLE '&TABUSERID'>
-* !IBI.FIL.&TABUSERID;
Welcome <br> &IBI_FIL
</body>
</html>
-HTMLFORM END
-RUN
-EXIT
This is the first and the simplest step of my project, and have to work so i can go on with other fex like this. The commented part are attempts that doesn't work. I've tried to do a template html
and added it in the fex with -INCLUDE template.html or -HTMLFORM template.html and failed
this is the output of every attempt I've done
in explorer I see: Welcome !IBI.FIL.TABUSER_MAT121234;
_____________________________
and the html of that page is:
<html>
<head>
<title>Title</title>
</head>
<body>
Welcome<br>
!IBI.FIL.TABUSER_MAT121234;
</body>
</html>
<!--
SET ASNAMES=ON
SET PAGE = OFF
SET NODATA=''
-RUN
-SET &LENEM = 0;
-SET &TABUSERID = 'TABUSER_' || MAT121234;
-SET &IBI_FIL = '!IBI.FIL.' || TABUSER_MAT121234 || ';';
TABLE FILE ADB_USER
PRINT NAME SURNAME
BY USERCODE NOPRINT
IF USERCODE EQ &USERID
ON TABLE HOLD AS TABUSER_MAT121234
END
-RUN
0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
-HTMLFORM BEGIN
-RUN
-EXIT
WebFOCUS Version 5.3.3 compiled and linked on Thu Dec 23 01:37:39 EST 2004 (Gen WEB533:47)
-->
The first step works fine, WebFocus save the hold file with the correct dynamic name and if I do a TABLE FILE &TABUSERID PRINT * END It work the HTML step doesn't work
I apologize for my bad English and I thank you in advance for any responseThis message has been edited. Last edited by: ExoR,
ExoR, If you change &IBI_FIL to being on a line by its self, it will help.
-* &USERID is passed by a form
-SET &USERID='ITALY';
-SET &TABUSERID = 'U_' || &USERID;
-SET &IBI_FIL = '!IBI.FIL.' || &TABUSERID || ';';
TABLE FILE CAR
PRINT COUNTRY
BY COUNTRY NOPRINT
IF COUNTRY EQ &USERID
ON TABLE HOLD AS &TABUSERID
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Title</title>
</head>
<body>
-* <!--WEBFOCUS TABLE '&TABUSERID'>
-* !IBI.FIL.&TABUSERID;
Welcome <br>
&IBI_FIL
</body>
</html>
-HTMLFORM END
-RUN
-EXIT
Also, the question arises, why do you want to create a long name, these files are temporary, unless you are keeping them, why have unique long names ?
This fex I've wrote over here is only a simple example, now I have to use this knowhow with other procedure that are more complex, and some of them take long time to end. If one user execute a procedure and take long time to produce a temporary table named "Example.ftm", and in the meanwhile another user execute the same procedure, I think there will be some problems. Otherwise if the procedure can produce an "Example_&UserID.ftm", both users can execute the fex without problems.
I think and hope there is a solution to create a session for every user logged in, but unfortunately i'm not paid for programming on webfocus, and the 80% of my work consist in other things, so i don't have the whole 8 working ours to spend on it so i have to choose the straight way. If it's not clean and it's not perfect but it works, i've to choose this way, and next time if i have free time to spend on it, i can try to do a better application.
The HTMLFORM technique is quite old and has an 8 character name limit. But if you create the FORM in the Layout painter and reference the report, then you can name the report as long as you like, and can concatenate USERID, DATE, etc into the name.
ExoR, are you aware that when a fex is run a separate temporary directory is created, all files are for each session are in these directories (Unless otherwise coded).
to Danny-SRL: no I don't need random name for table, but &FOCCPU is an interesting tip that i will remember
to GeraldCohen: i don't understand what you mean, why if i create a form manually and reference the report with a table name longer than 8 character doesn't work, and if i do the same in Layout painter it works?
to Waz: no, what you say doesn't happen in my case. I'm not the one who set up the server for webfocus, and the 2 technician that have done it are gone away years ago... actually there is no login request and no session for every user, but there is one session with one temporary directory for every coder. If i could i would like to do a "format c:" and start up with a clean server... but i can't...
-SET &DIR1='ADS_FOCEXEC_' || &PRGUSER;
-SET &TEMP='ADS_TEMP_' || &PRGUSER|| '\' || &USERID;
-SET &CTEMP= 'f:\ibi\apps\' || &TEMP
! md &CTEMP
APP PATH &DIR1 ADS_ENVIR_CONFIG ADS_FOCUS_DATA ADS_FOCEXEC_METEO &TEMP
APP HOLD &TEMP
APP HOLDMETA &TEMP
APP HOLDDATA &TEMP
-SET &TABUSERID = 'TABUSER_' || &USERID;
-SET &IBI_FIL = '!IBI.FIL.' || &TABUSERID || ';';
TABLE FILE ADB_USER
PRINT NAME SURNAME
BY USERCODE NOPRINT
IF USERCODE EQ &USERID
ON TABLE HOLD AS &TABUSERID
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Title</title>
</head>
<body>
Welcome <br> !IBI.FIL.&TABUSERID;
</body>
</html>
-HTMLFORM END
-RUN
-EXIT
&PRGUSER is the ID of the coder (me in this case) so every coder has his own temporary directory, and every fex executed by a coder produce temporary file in a proper directory, but the other 2 coder doesn't have an intranet site, they produce fex and run by themselves i've added the &USERID that is the login took with asp Request.ServerVariables("LOGON_USER") and passed to webfocus
it will become -SET &DIR1='ADS_FOCEXEC_EXOR' -SET &TEMP='ADS_TEMP_EXOR\ID3123' -SET &CTEMP= 'f:\ibi\apps\ADS_TEMP_EXOR\ID3123' ! md &CTEMP
but when i try to hold a file (ON TABLE HOLD AS &TABUSERID), i don't find it anywhere... the directory f:\ibi\apps\ADS_TEMP_EXOR\ID3123 exists, but it's empty. I've searched all the *.ftm file in f: created less than 1 hour ago, and I've found nothing.
the oddest thing is that the output of this procedure is correct, i can see correct response: Welcome Name Surname <-ibi filled table
so... i'm still working on itThis message has been edited. Last edited by: ExoR,
I'm beginning to ate filename length restriction of web focus... I can't associate to &TEMP a tree of directory that has a length greater then 18 characters I can create a Temporary directory tree like this made by 18 characters: -SET &TEMP='1\3\5\7\9\1\3\5\7\'; But if I try this made by 19 characters and less subfolder -SET &TEMP='1\3\5\7\9\1\3\56789'; doesn't work