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     Re: From browser ... -WRITEing a FOCEXEC to a PDS member

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Re: From browser ... -WRITEing a FOCEXEC to a PDS member
 Login/Join
 
Expert
posted
Can anyone read this posting correctly?

There appear to be 5 replies, but I can't see them, probably because there's a textarea tag in the embedded HTML code.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
I could read it.

What I did: I selected the in frame text, copied that to an editor and saved the file as test.htm.
then I opened the text and the info was readable.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Kerry,

If you have your "ears on", please can you perform an edit on the post to which Francis refers? Then we can all see the contents and the 5 (current) replies .

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Firstly, let me apologize for including some HTML in my original post that seems to have really screwed things up. I will not make that mistake again.

I thought I would repost my request here since I cannot seem to do anything with my original post including reading the replies.

We have been trying to fully implement MRE for a number of years without success.

So, out of desperation, I need to simulate something we bought MRE for... the ability to save FOCUS code to a user's PDS on the mainframe.

This may sound stupid, but I REALLY need to give the users, who would rather die than use the TED editor or ANY mainframe editor, the ability to create a save procedure on the mainframe.

Here is what I envision...

We have an adhoc screen that uses

TEXTAREA NAME="IBIF_adhocfex" ROWS="10" COLS="72" VALUE=" " ...


WebFOCUS takes what is in the TEXTAREA and ships it up to the mainframe to be processed. The resulting output is either a report or an error page. If the code produces a report 'without' an error, we would like to give them ability to save the code on the mainframe.

I envision being able to pass the FOCUS TABLE syntax up to the mainframe then do -WRITE (perhaps with a loop) to create the FOCEXEC (RPC) in the user's personal library.

I do not have the html/javascript experience to know whether something like this is actually possible.

Some kind hearted members of the forum have sent me FOCUS logic. I really appreciate it, but we know what we need to do with FOCUS, but I believe it may be html/javascript we are struggling with. If we were to send a textarea up to the mainframe, how do we interrogate the variable and parse it? We know textarea works with IBIF_adhocfex. How do we get it to work with another named variable?

I do not care if they have to copy and paste the code from the adhoc page to another html page that would then ship and save the code.

Any help would be greatly appreciate!

Thanks in advance,

Harry


FOCUS 7.3.4 on Z/OS
WebFOCUS/EDA 7.1.8 self-service - Win2003 and Z/OS
 
Posts: 36 | Registered: November 11, 2003Report This Post
Expert
posted Hide Post
Harry,

Thinking "on the hoof" and taking what you mentioned about a two pronged process (as near as).

How about setting a link in the header on the successful report labelled "Save Code" or something of the like, and then when the HREF is clicked, rerun the report with an additional parameter which reroutes the process flow to a focexec where a Users PDS is DYNAM ALLOC'd (with all the prerequisites) and then uses
-WRITE to write the contents of the TEXTAREA into that PDS?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Dumb question here. If you are MRE and they are creating reports, can they save them on the app server. Do you also have mainframe FOCUS and they want to run from a PDS there? Or is the save to a PDS just a back up purpose?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Expert
posted Hide Post
Hi Harry and all,

Really quick: I seem to have difficulties on editing Harry's other topic. I am checking with Kathleen to see what we can do to help here. Sorry for any inconveniences.

To those who did reply to the other topic (https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3301068802), can you please re-post your message here? Your suggestions are very important and we want to see them. Thank you in advance for understanding. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Platinum Member
posted Hide Post
(Re-posted from the other thread that went bonkers!!)
Harry :
It is a tad bit tricky, but you should be able to write to the mainframe. We have an application that Allocates a Sequential Dataset on the mainframe, -WRITEs a JCL line-by-line in it and then does a DYNAM SUBMIT to submit the job.

Here are some excerpts that could help you :
-*-*-*-*
-*-*-*-* Allocation step
-*-*-*-*
-SET &USER=GETUSER('A8');
-SET &TMSTMP = EDIT(HHMMSS('A8'),99$99$99);
-SET &DAY = EDIT(&DMY, $9$$$$);
-SET &DSNHJCL = 'XXXPPS.SOSSRPT.' | &USER || '.JCL' || '.D' || &DAY || &TMSTMP ;
-*
DYNAM ALLOC DD MAILJCL DS &DSNHJCL -
SPACE 5,15 TRKS CATLG RELEASE DIR 0 UNIT SYSDA -
LRECL 80 RECFM FB BLKSIZE 800 STORCLAS XXXXX
-RUN
-*-*-*-*-*-*-*-*-*-*-*
-*-*-*-* the -WRITE step
-*-*-*-*-*-*-*-*-*-*-*
-SET &COMMA=',';
-WRITE MAILJCL //AAAAAAAA JOB 'A123'&COMMA
-WRITE MAILJCL // 'EMAIL JCL'&COMMA
-WRITE MAILJCL // MSGCLASS=X&COMMA
-WRITE MAILJCL // CLASS=T,NOTIFY=&USER
-WRITE MAILJCL /*
-WRITE MAILJCL //*
-WRITE MAILJCL //ISTP0001 EXEC ABCDEFG,PARM='F'
-WRITE MAILJCL //*
.....................AND SO ON...............
... please note that you cannot end the line with a hard ',' comma
... assign the ',' to a variable and use it instead
........
-RUN
-*
-CLOSE MAILJCL
-RUN
-*
DYNAM FREE DD MAILJCL
-*
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**
-*
In your case Harry, you would be allocating and writing to a PDS and hopefully the same technique will work. Else you atleast have a PS to write to, and can be later copied to a PDS.
Also, the text-entry box will be a long string. Parse it out to max-80 character strings before doing the WRITE. You could use the 'SUBSTR' u-w-s to accomplish it.

Hope that helps to atleast give you an idea.

Goooooooooood day !!
Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Thank you all for your posts.

We are a win2003 shop with all of our data and code on a mvs mainframe.

We would like very much to user MRE; however, we have not been able to move to production due to a number of issues with the product.

So, in the meantime, I have to create a number of techniques that MRE would do quite easily if we could get it to work at our site.

I have a TEXTAREA box that successfully sends up one value for a variable named EZ (e.g., ? REL):

TEXTAREA NAME="EZ" ROWS="10" COLS="72" VALUE="" ALIGN=LEFT

When I try to send up more than one line, I get a FOC257:

0 ERROR AT OR NEAR LINE 21 IN PROCEDURE _EZWRITEFOCEXEC
(FOC257) MISSING QUOTE MARKS: '? REL '; ; i_html';

The EZWRITE procedure on the mainframe only has 5 lines of code, so I do not know why there is an error at line 21.

When I send up 2 FOCUS commands, I see the first one - ? REL; however, I do not know what the second one is ... i_html

I suspect it may be 'ibi_html' that has been truncated. Why and from where? I do not know.

I would love to send the entire TEXTAREA up to be interogated by the FOCUS code on the mainframe; however, it's not working.

Can anyone see where I am going wrong?

If I do not use TEXTAREA, is there a better tag or javascript to use?

Thanks,

Harry


FOCUS 7.3.4 on Z/OS
WebFOCUS/EDA 7.1.8 self-service - Win2003 and Z/OS
 
Posts: 36 | Registered: November 11, 2003Report This Post
Expert
posted Hide Post
Harry,

Have a look at the way IB runs an adhoc fex within their homepage links by checking out the file /ibi_html/homepage/adhoc.htm.

This should point you it the right direction for interpreting the textarea contents, hopefully.

Good luck.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Harry,

He's a sample HTML page that should help you progress further.

Basically the form submission is controlled by a button onclick event rather than using a submit button (type=submit).

The first part of the script identifies the object and "escapes" it - turns control characters into equivalents usable on the URL.
Next the form is submitted and finally the controls contents are "unescaped" so that the user still has their original code.

<html>
<head>
<title>Insert FTM file in Select</title>
</head>
<body>
<form name=form action=WFServlet target=_blank>
<input type=hidden name=IBIF_ex value=showvals.fex>
<span style="position:absolute; top:180; left:10;">Textarea</span>
<textarea name=ez style="position:absolute; top:180; left:200;" rows="10" cols="72" value=" ">
</textarea>
<INPUT  onclick="do_escape();" style="POSITION: absolute; TOP: 470px; LEFT: 160px; WIDTH:
                                      80px; HEIGHT: 30px;" type="button" value=Submit>
</form>
<script language=javascript>
function do_escape() {
  TXobj = document.getElementById("ez");
  TXobj.value = escape(TXobj.value);
  document.form.submit();
  TXobj.value = unescape(TXobj.value);
}
</script>
</body>
</html>


The showvals fex that I have put in the IBIF_ex value just contains "-? &" so that I can see the variable values being passed over. You will see that each carriage return and line feed is escaped to "%0D%0A" which is the equivalent of "CHR$(13)CHR$(10)" or "vbcrlf" etc. etc. depending upon your programming language.

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Thank you Tony.

Yesteday, I decided to search the entire IBI directory on our server for IBIF_adhocfex. I browsed all of the files. It looks as though IBI does something under the covers to use this variable in a TEXTAREA. So, my thoughts on simply sending up a TEXTAREA to the mainframe to be processes was flawed due to my lack of experience.

From the code you sent, it appears that you are making an array of the TEXTAREA. The code did not work in Netscape. In IE, I see the variables being passed correctly in the URL but get a The page cannot be found message. With my limited javascript experience, I will continue to play with your code.

I guess, if I had to post this question on the Forum again, I would ask - "How do I send a multiline TEXTAREA to the server?"

I would have thought IBI would have developed a technigue for this.

Thanks for your ideas... it is leading me in the right direction even if I do not know how to get there.


FOCUS 7.3.4 on Z/OS
WebFOCUS/EDA 7.1.8 self-service - Win2003 and Z/OS
 
Posts: 36 | Registered: November 11, 2003Report This Post
Expert
posted Hide Post
Harry,

Remember that the one eyed man is King in the Blind Man's World

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Like a dog with a bone - this has got me thinking.

On the HTML page you could add an extra button that prompts the User for a file name. Then strip it to the first 8 non special characters (incl spaces).

Pass this as a variable to your focexec on the server and then filedef or dynam alloc - as your platform requires - and parse it to enable a write to the filedef'd file.

Here's a quick trial that did write to a folder on my documents folder. It uses defaults so you should be able to run this once you have found out a few things.

Find the value for FOCMODE on your platform using ? SET and looking for the value of MODE. Add or amend a label to include your platform's filedef requirements. I have added one for WINNT and others for VMS and OS390 (it used to be MODE = MVS I think - but it was a while ago) with some DYNAMs. You will need to change these as necessary.

-SET &UserId = GETUSER('A8');
-DEFAULT &FileName = 'SaveFile'
-* Put the following on one line
-DEFAULT &AdhocFex = 'TABLE%20FILE%20CAR%0D%0ASUM%20RCOST%0D%0A%20%20%20%20DCOST%0D%0ABY
%20COUNTRY%0D%0ABY%20CAR%0D%0ABY%20MODEL%0D%0AEND'

-GOTO :&FOCMODE ;

-:WINNT
  FILEDEF SAVEFILE DISK \\server\shared_dir\&UserId.EVAL\&FileName.EVAL.fex
-GOTO :EndAlloc;

-:OS390
  DYNAM FREE FILE(SAVEFILE)
  DYNAM ALLOC SAVEFILE etc.
-GOTO :EndAlloc;

-:VMS
  FILEDEF SAVEFILE DISK ### required syntax for VMS installation ###
-GOTO :EndAlloc;

-:EndAlloc
-RUN

-SET &Cnt = 1;
-TYPE &AdhocFex
-SET &AdhocFex = &AdhocFex || '~EndOfFile';
-SET &AdhocFex = STRREP(&AdhocFex.LENGTH, '&AdhocFex.EVAL', 6, '%0D%0A', 1, '~', &AdhocFex.LENGTH, 'A&AdhocFex.LENGTH');
-SET &AdhocFex = STRREP(&AdhocFex.LENGTH, '&AdhocFex.EVAL', 3, '%20', 1, '#', &AdhocFex.LENGTH, 'A&AdhocFex.LENGTH');
-SET &AdhocFex = CTRAN(&AdhocFex.LENGTH, '&AdhocFex.EVAL', 35, 32, 'A&AdhocFex.LENGTH');
-TYPE &AdhocFex
-SET &Line = GETTOK(&AdhocFex, &AdhocFex.LENGTH, &Cnt, '~', 80, 'A80');
-REPEAT :Loop WHILE NOT(&Line CONTAINS 'EndOfFile');
-WRITE SAVEFILE &Line
-*-TYPE &Line
-SET &Cnt = &Cnt + 1;
-SET &Line = GETTOK(&AdhocFex, &AdhocFex.LENGTH, &Cnt, '~', 80, 'A80');
-:Loop


I wanted to use STRREP throughout but for some reason I always got an error when trying to replace "%20" with " " - it complained about the space (parameter number 6). Ah well, any method I suppose.

Anyway, a piece of code that should be fairly transportable to play with Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Silver Member
posted Hide Post
Thanks Tony for you ideas. I have given your suggestion consideration. Your idea would be good for small procedures; however, many of our execs are 50-100 lines long. The &er variable is not going to handle that.

Over the last few days, I have been teaching myself the javascript language. I have come up with something close (or so I thought until 5 minutes before leaving from work last night).

While testing the code (see below), I entered in nonsense characters without spaces and it worked fine. When I showed my manager he was impressed until he asked me to type in a complete sentence. When I did, I found the code only grabbed the first word of every line.

Here is the html code with the javascript (it may not be too good; however, remember, I just started teaching myself this stuff):

<HTML>

<HEAD>
<TITLE> New Document </TITLE>

<SCRIPT Language = JavaScript>

function showit()
{
//Store each line of textarea as array element
var textArr = document.getElementById("WFid").value.split("\r");
var textLen = document.getElementById("WFid").value.length;
str = " ";
for (i = 0; i < 10; i++)
{
if (textArr[i] == null)
{
// document.write("Null value" + i)
}
else
{
str = "<INPUT TYPE=hidden NAME=W" + i + " VALUE=" + textArr[i] + "> <br> \r"
d.writeln(str)
}
}
}

function WFpage()
{
runWindow=open("","runWindow","resizable=yes,status,width=800,height=600");
d = runWindow.document
d.writeln("<HTML>");
d.writeln("<form action='/ibi_apps/WFServlet' method='POST'>");
d.writeln("Press Run to save code:<br>");

showit(this)

d.writeln("<input type='submit' name='Submit' value='Run Report'>");
d.writeln("<input type='reset' name='reset' value='reset'>");
d.writeln("<input type='hidden' name='IBIF_ex' value='SHOWVALS'>");
d.writeln("<input type='hidden' name='IBIC_server' value='EDASERVE'>");
d.writeln("<input type='hidden' name='TUHTML' value='EZWRITE'>" );
d.writeln("<input type='hidden' name='&TUEXEC' value='EZWRITE'>");
d.writeln("</FORM>");
d.writeln("</BODY>");
d.writeln("</HTML>");
d.close();
}


</SCRIPT>
</HEAD>

<BODY>
<form name=WFform>
<textarea id=wfid name=WFtext rows=10 cols=80></textarea>
</form>
<input type=button value="Run" onClick=WFpage()>
</BODY>
</HTML>

After the user enters the text in the textarea, they click on the Run button which kicks off the WFpage function. This function builds another html page and will put each line of the textarea into a separate variable with the following code:

str = "<INPUT TYPE=hidden NAME=W" + i + " VALUE=" + textArr[i] + "> <br> \r"
d.writeln(str)

If I enter

TEST1
TEST2
TEST3

in the textarea, the WFpage function creates the following:

<HTML>
<form action='/ibi_apps/WFServlet' method='POST'>
Press Run to save code:<br>
<INPUT TYPE=hidden NAME=W0 VALUE=TEST1> <br>

<INPUT TYPE=hidden NAME=W1 VALUE=
TEST2> <br>

<INPUT TYPE=hidden NAME=W2 VALUE=
TEST3> <br>

<input type='submit' name='Submit' value='Run Report'>
<input type='reset' name='reset' value='reset'>
<input type='hidden' name='IBIF_ex' value='SHOWVALS'>
<input type='hidden' name='IBIC_server' value='EDASERVE'>
<input type='hidden' name='TUHTML' value='EZWRITE'>
<input type='hidden' name='&TUEXEC' value='EZWRITE'>
</FORM>
</BODY>
</HTML>


This code produces 3 variables (&W0, &W1 and &W2):

<INPUT TYPE=hidden NAME=W0 VALUE=TEST1> <br>

<INPUT TYPE=hidden NAME=W1 VALUE=
TEST2> <br>

<INPUT TYPE=hidden NAME=W2 VALUE=
TEST3> <br>

Please note how the &W0 INPUT line has been generated; then note how the next two are generated. Because of my lack of understanding of javascript, I do not know why it is splitting.

The real pain is not being able to put spaces between the word.

I have tried putting the VALUE= text in double quotes with \":

str = "<INPUT TYPE=hidden NAME=W" + i + " VALUE=\"" + textArr[i] + "\"> <br> \r"

This did not work as expected.

Because of my lack of experience, I do not know whether this venture in code is as foolish as searching for the Holy Grail; however, I would have expected IBI to have come across the need to send an entire textarea to a server to be parsed. Well, they do it with the IBIF_adhocfex variable. Unfortunately, this variable does not appear when one does a '-? &'. I have tried to follow the java code IBI uses for this variable; however, my lack of experience prevents me from fully understanding what is going on.

Maybe, if someone from IBI reads this, they will take pity on an old, beat up coder and give me some idea how to do this. The only reason I started this foolish venture is due to our users need to save code on our mainframe without having to sign on to the box and use what they thing are ancient editors. We had expected to have MRE installed in a production environment; however, that is not going to happen any time soon.

My thanks again for all those who have responded!

Harry


FOCUS 7.3.4 on Z/OS
WebFOCUS/EDA 7.1.8 self-service - Win2003 and Z/OS
 
Posts: 36 | Registered: November 11, 2003Report 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     Re: From browser ... -WRITEing a FOCEXEC to a PDS member

Copyright © 1996-2020 Information Builders