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     [SOLVED] Conditional DSTRUN

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Conditional DSTRUN
 Login/Join
 
Platinum Member
posted
Hi all
I have a fex which uses DSTRUN to kick off a schedule. The schedule in turn saves a file in Report Library.
The problem is that DSTRUN should be executed only after the file has been created (creation of file is a part of the same fex).
Here's what my fex looks like:

FILEDEF EXCELOUT DISK &TEMP_PATH
TABLE FILE ABC
PRINT *
ON TABLE HOLD AS EXCELOUT FORMAT EXL2K
END

********This is where I want DSTRUN to hold on till the above file is created

-SET &SUBERR=DSTRUN(
- 'usr', 7,
- 'pwd', 7,
- 'srverRazzerort', 16,
- &SCH_JOB_ID,12,
- ' ', 0,
- 3,
- 'ownr', 7,
- ' ', 0,
- ' ', 0,
- 'I4') ;

-RUN

----------
When the excel is small, the above code works fine and the excel gets saved to Report Library. Whereas, if the excel takes a lot of time to get created, DSTRUN triggers off the schedule and the excel doesn't get saved to Library.

I have tried using STATE/UNIX ls/SLEEP etc. But DSTRUN always gets executed before the excel creation is complete.

Any suggestions on how to deal with this situation?

Thanks
Syed

This message has been edited. Last edited by: Syed,


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Virtuoso
posted Hide Post
Try:

FILEDEF EXCELOUT DISK &TEMP_PATH
TABLE FILE ABC
PRINT *
ON TABLE HOLD AS EXCELOUT FORMAT EXL2K
END
-RUN   <-- Add this *before* DSTRUN is executed

-SET &SUBERR=DSTRUN( ...


Adding -RUN makes the stacked commands to execute before moving forward to the next step. Hopefully it'll work as you need.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
-RUN is the way to go nsjden !
I just tried it and it seems to be working fine.

Thanks much for the suggestion.

Syed


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Virtuoso
posted Hide Post
You're welcome Syed. I'm glad it helped.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
quote:
-RUN is the way to go nsjden !
I just tried it and it seems to be working fine.
It is great that folks get a solution to their question, but I sometimes wonder if they realise why the suggestion works?

Syed, Do you comprehend why the addition of -RUN works or are you just happy that you have a solution? I ask only because if you don't understand the reason, and you hit the underlying problem again, you may ask the same basic question again.

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
Platinum Member
posted Hide Post
Hey Toni
As much as I understand, -RUN forces execution of all WebFOCUS commands/code before continuing with the rest of the procedure. In a way it acts like a checkpoint, ensuring execution before the next command is executed. And that's exactly what I was looking for - something that would complete the creation of excel file (ON TABLE HOLD AS EXCELOUT FORMAT EXL2K) before DSTRUN was fired.
Since FOCUS is a procedural language, execution of a code in WebFOCUS does not require the execution of its previous stack of commands.

Let me know if there's more to it.

Thanks
Syed


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Expert
posted Hide Post
Hi Syid,

Just wanted to make sure that you understood why the -RUN was required. It looks like you did some digging Smiler but it's not always obvious that the answer is understood.

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
Platinum Member
posted Hide Post
Sure. I should have mentioned this explanation in my previous post - I got so excited with the solution, that I quickly wanted to get the ball rolling Big Grin

But thanks - I'll keep this in mind...

Cheers
Syed


Using WF 7.1.7/Dev Studio
 
Posts: 189 | Location: Boston, MA | Registered: July 12, 2005Report This Post
Virtuoso
posted Hide Post
quote:
Adding -RUN makes the stacked commands to execute before moving forward to the next step


I had provided Syed with some explanation as to why -RUN was most likely the solution he needed. It may not have been the most technical description of what it does but that's what the product manuals are for, is it not?.

Anyway, Tony has raised a valid point which is always good to keep in mind. It's more important to understand the conceptual logic behind any solution before worrying too much about specific syntax which can always be looked up in a manual.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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     [SOLVED] Conditional DSTRUN

Copyright © 1996-2020 Information Builders