Jump to content

Ive used DOS command in a .fex, but Ive never used a Windo...


Mark Katz

Recommended Posts

The reason Im asking about Notepad is that the first WF procedure uses a DOS command to combine/append two flat files into one file. A subsequent WF procedure FTPs that combined file to another computer. For the focexec in question, Id like the user to be able to look at that combined file before FTPing it. I could TYPE the file in WF, but because the record length is 750 bytes, the file will wrap and its not that easy of a file to look at when it wraps. The user could go to File Explorer to look at the combined file in Notepad, but Id like all of these tasks run from WF, if possible.

Thanks,

Mark

Link to comment
Share on other sites

Thanks Mark

I kind of see where you want to go.

I have a question:

for the 2 files that get combined into one using a DOS command, where do those reside are they in a temp locations (like edatemp for foccache) or are they in a real disk location

The catch here is for you to remember that youre asking to break your process in half. You need to build the data (after the data is copied into a single file) and ask the user if the data looks okay (use a master file and WF Report as Chuck suggested).

If the user says the file looks good for transmission, only then do you send a request over to the reporting server to run the DOS command to cause the FTP to happen.

So youd like your file to have some persistence on your reporting server while youre asking if the data looks good or not. A real location on the drive is helpful there. You could use foccache for this also (keeps the file alive as long as youre in the same WF Client session).

An additional thought is to try to do the combining of files using WebFOCUS and the MORE command instead of leaving that up to your DOS command. This way, the only DOS command youre dealing with is the FTP task. Even that part might be doable under WebFOCUS as a Caster job if you wanted to fire off that task. Just depends how much youre trying to avoid DOS commands.

Does the flow make sense to you

 

create the file on the reporting server and show it to the user for approval.

the user approves the FTP (or cancels it) by kicking off another focexec that does the actual FTP.

Link to comment
Share on other sites

I think I understand and like Chucks idea about doing a TABLE FILE of the combined file.

I understood some, but not all, of what Toby said. The 2 files that get combined are in a real location on the server. And your summary is, I think, what Im trying to do. And now I think I know how to do it with a TABLE FILE instead of my original thought of using Notepad.

Thanks a lot guys,

Mark

Link to comment
Share on other sites

How about something like the code below You could use an HTML form to prompt the user for whether they would like to continue with FTP. Then pass &CONTINUE with the value of yes or no to a fex procedure.

With the data file on baseapp, a FILEDEF and !IBI.FIL.DATAFILE; displays the file contents in a pre tag.

FILEDEF DATAFILE DISK baseapp/datafile.txt

 

-HTMLFORM BEGIN

 

<form action="/ibi_apps/WFServlet" target=_new>

<input type=hidden name=IBFS_path value="IBFS:/WFC/Repository/Public/Procedure1.fex">

<input type=hidden name=IBFS1_action value="RUNFEX">

Please review data file below. Continue with FTP

<select name="CONTINUE">

<option value="yes">yes</option>

<option value="no">no</option>

</select>

<input type=submit value="Run">

</form>

 

<pre>!IBI.FIL.DATAFILE;

</pre>

 

-HTMLFORM END

Link to comment
Share on other sites

David,

Originally, I was going to say thank you but I dont really know HTML and I liked the previous suggestion. But I thought I would at least try to adapt what you have, and it worked and I like it! Actually, the only part I really need is what you have at the very end - IBI.FIL.DATAFILE. I changed that (& the FILEDEF, above) to my file and it does what I wanted. Even though I originally mentioned Notepad in my post, I only wanted to do something that looked like Notepad. I dont need to edit the file, but to just view it (without wrapping). And what you have does that.

I already have a separate WF procedure which does the FTP, but I tried to adapt your code for that to see if I could figure what you did. But that one I couldnt get to work. Assuming your Procedure1 is what has the FTP, I couldnt get that syntax right. I tried a few things but got a few different errors. I think some errors were that it couldnt find the path and didnt like the slashes in the path. Maybe the issue is that you mention Repository. But Im doing self service and thus the procedure isnt in the repository. I may have some of that wording wrong because Ive never gotten a handle on self service vs managed reporting (I think thats what it was called when we first used WF years ago). But even though its neat to have the run in your example, I dont think I would use it even if I could figure it out (because the FTP focexec is already a separate option).

Thanks,

Mark

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...