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     Associating a variable with a field in Stack

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Associating a variable with a field in Stack
 Login/Join
 
Silver Member
posted
I am a noobie to Maintain and am looking to capture the curent system date using Today () to a variable and the associate the variable with a field in a stack and then Update the stack back to the db.


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report This Post
Virtuoso
posted Hide Post
Personally, I always use today2 to get the system date, because that one also has the century information.
But, because the result of today or today2 is almost never how I need it to be, I always have to manipulate the result to get what I need.
Example:
Compute date/a10 = today2();
Compute h1/a8 = mask(date,'$$$$$$9999') | mask(date,'99') | mask(date,'$$$99'); 
Compute h2/i8yymd = edit(h1);
Compute thisday/yymd = h2;

And after this today's date is available to me in the variable thisday.
This can be used to be stored in stack fields or whatever you wish to do with it.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Thanks for this info. I am still looking for how to move this variable into a text box and then from the text box to a field in the stack.


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report This Post
Master
posted Hide Post
Creating variables and moving them on and around a form is very simple.

Let's say you have:
COMPUTE TEST/A10 = 'MAINTAIN';

You can display that on the form in a text box in 2 ways. The first way is to just drag that variable from the Object Explorer onto the form. This creates a field on the form that can be accessed in the code.

The other way is to click on the EditBox object on the Controls Palette and draw the rectangle on the form. Double click on it, and then you can assign the variable to the object.

As for using stacks, it's pretty much the same. You can load fields into a stack:
FOR ALL NEXT MOVIECODE INTO STK
and the drag the stack or individual fields onto the form.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
I am successful in associating the date with the edit_field. I am still looking for a code example to move the date into the stack prior to issuing the Update command. I have the FocIndex value captured coming into the code listed below:


acronym_dictionary_master_table.ACRONYM_DICTIONARY_MASTER_TABLE.DATE_LAST_UPDATE = TodayDate
**************************************

Code to associate the date with field in stack.

**************************************

Update
acronym_dictionary_master_table.ACRONYM_DICTIONARY_MASTER_TABLE.DESCRIPTION acronym_dictionary_master_table.ACRONYM_DICTIONARY_MASTER_TABLE.DATE_LAST_UPDATE from listSTK() ;
Commit


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report This Post
Master
posted Hide Post
Using the example that you have provided, you would do this:

Compute listSTK.DATE_LAST_UPDATE = TodayDate;
Update fields from listSTK

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
OK, I am still not successful in getting the date back into my db via the stack. Here is the code, can sanyone shed any light on what I am missing?

Case fnt_update

Compute CNT = listSTK.FocIndex

Compute listSTK.DATE_LAST_UPDATE = TodayDate;


Update acronym_dictionary_master_table.ACRONYM_DICTIONARY_MASTER_TABLE.DESCRIPTION
acronym_dictionary_master_table.ACRONYM_DICTIONARY_MASTER_TABLE.DATE_LAST_UPDATE from listSTK(CNT) ;
Commit

EndCase


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report This Post
Silver Member
posted Hide Post
Maintain Wizard

Janice says you are the resource who can help me with this. Can you contact me directly ?

513-841-7153


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report This Post
Silver Member
posted Hide Post
Maintain Wizard corected issue with syntax listed below:

Module Import(MNTUWS) under MAINTAIN FILE

Compute DateT/HYYMDI = HGETC(20,DateT) under CASE Top

compute stack_name.field_name = DateT under Update Case


WebFOCUS 7.6.4
Windows
 
Posts: 30 | Registered: May 14, 2008Report 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     Associating a variable with a field in Stack

Copyright © 1996-2020 Information Builders