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
SYSTEM
 Login/Join
 
Platinum Member
posted
can anyone see what is weong with this code? I am trying to create a save file, in different formats and then copy it to the users requested folder. I saw this code on a forum a while back and decided to try it out, but can't get it to work. Any Ideas? Anyone?



-SET &CPY_FILE = 'XCOPY ' | &FILE_NAME | '.' | &FILE_TYPE | ' ' | ©_NAME | '.' | &FILE_TYPE ;
.
.
.
-SET &RC = SYSTEM(&CPY_FILE.LENGTH,&CPY_FILE, 'I1' );


this is the trace file that was generated...
-SET &RC = SYSTEM(74,XCOPY \\MK400BLD1\C\INETPUB\WWWROOT\OUTPUT_HOLD\RUCK.XLS C:\TOOLS\RUCK.XLS, 'I1' );
0 ERROR AT OR NEAR LINE 131 IN PROCEDURE MEMFEX FOCEXEC *
(FOC36355) INVALID TYPE OF ARGUMENT #3 FOR USER FUNCTION SYSTEM

This message has been edited. Last edited by: <Mabel>,
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Platinum Member
posted Hide Post
ok. I tried another method posted on the forums anf this what I get....





-SET &CPY_1 = &FILE_NAME | '.' | &FILE_TYPE ;
-SET &CPY_2 = ©_NAME | '.' | &FILE_TYPE ;
-*

-DOS COPY '&CPY_1' '&CPY_2' /Y;

.
.
.
and this is what I get when I run the FEX....
-DOS COPY \\MK400BLD1\C\INETPUB\WWWROOT\OUTPUT_HOLD\GUNIT.XLS C:\TOOLS\GUNIT.XLS /Y;
The system cannot find the file specified.[/code]but I know the file exists because I just created it in the FEX, and I can see it in explorer. Any Ideas? Any one?

This message has been edited. Last edited by: <Mabel>,
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Expert
posted Hide Post
take the - out before the DOS, but
I use CMD, not DOS
and i map a drive to the server
so its really easy
CMD COPY d:\ibi\...\file.ext j:\ibi\...\file2.ext /y
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
when I try I still get an error




CMD COPY '\\10.11.10.16\C\INETPUB\WWWROOT\OUTPUT_HOLD\YAYO.XLS' 'C:\TOOLS\YAYO.XLS' /Y;

END

0 ERROR AT OR NEAR LINE 138 IN PROCEDURE MEMFEX FOCEXEC *
(FOC002) A WORD IS NOT RECOGNIZED: CMD
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND
and 'DOS' with out the - either......

This message has been edited. Last edited by: <Mabel>,
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Virtuoso
posted Hide Post
Lloyd --

1. In the SYSTEM() call in your first post, change the last arg from 'I1' to 'D4'
(per: http://documentation.informationbuilders.com/masterinde...53func/system11.htm, rc is a double-precision value)

2. In -DOS COPY '&CPY_1' '&CPY_2' /Y;
in the second post, remove the trailing ";".

-JG
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Jack

Very useful info. Is there anything comparable for an opsys other than Windows, do you happen to know? Unix, for example.

Thanks. Suzy
 
Posts: 124 | Location: Lebanon, New Hampshire | Registered: April 24, 2003Report This Post
Virtuoso
posted Hide Post
If I recall correctly,

! xxx
UNIX xxx
-UNIX xxx

all work (where xxx is any unix command)

-- not sure whether the "unix" keyword must be uppercase, or must be lowercase; the submitted command must be in whatever case Unix expects.

-- if I recall incorrectly, I am sure I will be corrected forthwith. Big Grin

As with DOS and -DOS, w/o the dash it's a Focus command (whose execution waits for -RUN), with the dash it's a Dialog Manager (immediate execution) command.

Back in the days of 80-column limits (WF 4.x and earlier), -DOS lent more flexibility, in that &vars appearing in the command (or as the entire command) could expand it beyond Mr. Hollerith's limit -- whereas the resolved "DOS" command was limited FOCSTACK's limit of 80. Nowadays (WF 5.x) it's inconsequential, except for order of execution.

Regarding CMD: For Windows, DOS (or -DOS) is required to submit a CMD command-string; DOS is a Focus keyword, CMD isn't. Or else wrap it in the SYSTEM() function.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Thanks, Jack for catch the paremeter type problem, all of the examples I saw had it as I4(it became I1 because I was trying everything)

But, I still get the error 'The system cannot find the file specified.'. the thing is when I run this command from the CL. it copies fine no problem. Could it be that the browser session doesn't have permission to the Server drive?
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Virtuoso
posted Hide Post
[qb]
-SET &CPY_1 = &FILE_NAME | '.' | &FILE_TYPE ;
-SET &CPY_2 = ©_NAME | '.' | &FILE_TYPE ;
-DOS COPY '&CPY_1' '&CPY_2' /Y;

and this is what I get when I run the FEX....
-DOS COPY \\MK400BLD1\C\INETPUB\WWWROOT\OUTPUT_HOLD\GUNIT.XLS C:\TOOLS\GUNIT.XLS /Y;
The system cannot find the file specified.[/CODE][/qb]

Two theories why it cannot find the specified file:

1. Quoting is for the benfit of DOS, not Focus, and only necessary if the file-names may have imbedded spaces or whatnot. My impression is that dos treats single-quote as just another character.
Change those single-quotes to double-quotes.

2. Are you certain that DOS on that server understands the \\location\path\file syntax?
Add
-DOS VER
-DOS DIR "&CPY_1"

before the
-DOS COPY "&CPY_1" "CPY_2"
to verify the DOS version, and see whether at least parts of that DOS version understand that syntax.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Lloyd, it seems you have your CMD within a fex table, as there's an END statement after it. As Jack reminds, its a system-level command , not a focus command so it needs to be outside of a TABLE..END paragraph. Also the ; after the /Y isn't necessary, and again as Jack reminds, the quotes aren't needed either. The CMD elevates the capabilities of the DOS command, seemingly.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Silver Member
posted Hide Post
If you have access to the server, try going to that address from the server. If it says "the system cannot find the path specified", it's possible that you have to create a mapping to the shared folder, like Susannah suggested.

Also, check if there's a C:\TOOLS\ directory on the server, because that's where it's going to be copied to.
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Report This Post
Silver Member
posted Hide Post
This is what we're using in a pre-execution step in an ETL Job:

!net use J: \\serverXX\group /USER:domainname\username password
!c:
!copy J:\some_other_dir\*.xls E:\target_dir
!net use J: /delete
!d:

The E:\target_dir is located on the server.

The ! is for executing system commands.
"net use" is a windows command that creates the mapping to a networkdrive. Afterwards we use this mapping (drive letter JSmiler in the copy command.
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Report This Post
Expert
posted Hide Post
wow Tim...are you saying that !net use is a way to create a mapping on the fly...so that i don't have to maintain a persistent connection to that drive??
(are you in a windows server env or some other server env?... that ! looks unix to me ..i don't speak unix)
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
Thanks everyone for all your help with this...

Susannah..yeah I had realized that late last night and actually moved it outside the table request, but it still seems that my fex doesn't complete and it still can't find the file...I think I may have to use javascript to do the transfer

...or is there a way to tell webfocus to wait until the table request completes?

Tim...yeah I don't like using 'net use' in scripts because it can cause problems like clobbering existing mapped drives...I was only testing so I was trying to send it to my local C: drive which doesn't seem to work...I assumed that it would work like copy in a Command line(copy from server to local drive)...When I go into production, the shares will already be in place and I'll use the IP address to get at the shared drive....
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Platinum Member
posted Hide Post
Got it....

using -RUN completes the fex before my Copy command gets interpreted.....

whew.....learning in the trenches is hard....
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Master
posted Hide Post
susannah

! is there to tell webFOCUS that the following command is a unix command and to pass it off to the OS.

NET USE shoud work on Windows also
 
Posts: 865 | Registered: May 24, 2004Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by susannah:
[qb] wow Tim...are you saying that !net use is a way to create a mapping on the fly...so that i don't have to maintain a persistent connection to that drive??
(are you in a windows server env or some other server env?... that ! looks unix to me ..i don't speak unix) [/qb]
Yes, "NET USE" allows you to create a mapping on the fly.

That "!" is just a FOCUS command, I think it works like -CMD or SYSTEM().

And "NET USE" is just a windows command.
I probably don't have to mention the annoying "NET SEND" command, because everyone in a windows environment will probably have experienced that annoying little window with the OK button stating an "informational message from your network administrators". Hehe.

quote:
Originally posted by Lloyd
[qb] Tim...yeah I don't like using 'net use' in scripts because it can cause problems like clobbering existing mapped drives [/qb]
If there's already a mapping with the same drive-letter, it's simply skipped. You'll get an error like "Mapping already exists" or something like it.
 
Posts: 44 | Location: Belgium | Registered: January 10, 2005Report This Post
Platinum Member
posted Hide Post
Really...way back when we ran windows over novell it used to happen all the time (I know long time ago..but try telling the old dog that Wink ).......
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
<Pietro De Santis>
posted
You can never have too many -RUN statements - this is, if you put them in the right place.

I put one after a set of JOIN statements, after every END statement, every DOS or SQL command.

In my own layman's terms, the FOCUS interpreter adds program code to the "stack" and the stack gets executed when the end of the FEX is reached, or when a -RUN in encountered. Using -RUN statements ensures a piece of code gets executed before the next one. The added bonus is that if there are any errors, they will be displayed where the error actually occurs, not at the end of the FEX.

As far as I know, Developer Studio does not add the -RUN statements.

My tuppence worth.

Pietro.
 
Report This Post
Expert
posted Hide Post
what a great idea for a NFR !
-RUN by devstu at every END statement.
And thanks Tex for the info on CMD NET USE
That wee tidbit has just revolutionized my life!
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
Based on a primordal Focus Jnl article by Greg Dorman:

Execution of a Focexec is basically a tag-team affair, with control alternating between two players, who actually have very little vocabulary in common.

Player #1, who understands dialog manager (& variables, - commands) but doesn't understand Focus langauge, parks resolved or generated lines of Focus code in FOCSTACK, and (at eof or -exit or -run) puts its & variables on ice and passes the baton to player #2, the executioner.

#2 understands Focus (JOIN, TABLE, etc.), but not Dialog Manager (seeing no special significance in the & and - characters). #2 just runs the stacked Focus commands, and then passes control back to a fresh instance of #1, who restores all the & vars and reads on.

(The sole knowledge that #1 has about Focus is that blank lines are insignificant, and need not be stacked. Sometimes you really need to stack a blank line (perhaps as DATA for MODIFY), but there is a work-around.)
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Jack, that's very interesting and put's things in perspective. Being the old dog that I am, I like to know how things are SUPPOSED to work. it helps you to understand what to dod and what not to do.

What I haven't been able to find is a good resource that expalins the Focus language internals and how it operates. Do you know of any? I tried browsing focalpoint but there's just too much to through......
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Virtuoso
posted Hide Post
Try the Kbase. Licensed users can register (techsupport.informationbuilders.com), and search the full knowledge base, which has a much broader sweep than this Forum's tech doc library.

That also let's you submit cases online, as opposed to verbally via the 800 number.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
Check out the documentation

WebFOCUS Developing Reporting Applications

Version 5 Release 2 DN4500514.0903
or
Version 5 Release 3 DN4500578.0904

Chapter 10 discusses Managing Flow of Control in an Application

This discusses Managing Flow of Control in an Application - ie. Dialog Manager
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders