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] Maintain - Trying to copy data from one stack to another for REVISE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Maintain - Trying to copy data from one stack to another for REVISE
 Login/Join
 
Silver Member
posted
Hi,

I am extremely new to webfocus and maintain and have been learning a lot over the past few weeks reading through a lot of posts. However, I have been stuck on this one problem and I can't seem to figure it out.

Here is what I am trying to do. I have a datastack that is being created by a procedure that has the following fields: LCATEGORY,LKUP_FIELD,VIEW_FIELD and SORT_FIELD.

What I am trying to do is copy the rows from this data stack into another datastack (that has the exact same fields) so that I could then run a REVISE in order to add/update to the foc file that is linked to this second datastack.

I read that you have to have the data in the datastack that is linked to the foc file in order to be able to run the REVISE command.

I have tried running the following code but that doesn't seem to work:

 FOR ALL COPY FROM trimmStk(1) INTO F_lookupStk; 


F_lookupStk is the one that I am trying to get the data into so that I can run the REVISE command in order to add/update the data in lkup_fields.foc.

What am I doing wrong here?
Would I have to create a procedure that would do this for me? If so, can someone post a quick example of what I might need to do?

Any help is appreciated.

Thanks,
Prince

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


Webfocus 8, All Outputs

 
Posts: 47 | Location: Atlanta, GA | Registered: June 09, 2011Report This Post
Expert
posted Hide Post
Have you verified that the stack is not being populated, or that the revise is not inserting/updating ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Indeed, this one line of code isn't enough to be able to pinpoint the problem. And as Waz says, verify that the stack isn't being copied, for instance by putting both stack on the (a) form with the html grid. While you're at it, also put the foccount of both stacks on the same form. That way you know how many records are in both stacks.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Master
posted Hide Post
There are two ways to copy data from one stack to the other. STACK COPY and COMPUTE. You can only use stack copy when both stacks have been created from the same Master file. You don't saw how the stacks are created. If
both stacks ARE created from the same Master, then it should work.

So if you have:
Infer LCATEGORY,LKUP_FIELD,VIEW_FIELD SORT_FIELD into trimmstk
Infer LCATEGORY,LKUP_FIELD,VIEW_FIELD SORT_FIELD into F_lookupStk

Then you can do a FOR ALL or STACK COPY. However, if the stacks have the same field names but have been created from different Masters, you can do this:

Compute i/i3=1;
repeat trimmstk.foccount
Compute F_lookupstk(i).LCATEGORY = trimmstk(i).LCATEGORY;
Compute F_lookupstk(i).LKUP_FIELD= trimmstk(i).LKUP_FIELD;
Compute F_lookupstk(i).VIEW_FIELD= trimmstk(i).VIEW_FIELD;
Compute F_lookupstk(i).SORT_FIELD= trimmstk(i).SORT_FIELD;
Compute i=i+1;
endrepeat

Let me know.
Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
Hi Mark,

The stacks are being created by different master files. So I figured the stack copy method would not work. I will try the method that you described below and let you know how that turns out. Thanks so much for the help!


Webfocus 8, All Outputs

 
Posts: 47 | Location: Atlanta, GA | Registered: June 09, 2011Report This Post
Silver Member
posted Hide Post
Okay, So I tried running the loop that you gave and it doesn't seem to be saving anything in F_lookupstk. I checked with a simple html table to view what's in trimmstk and all the values are there. But when I run the above code and then try to view what's in F_lookupstk in a html table, It just seems to be coming up completly empty. No values at all. Would it have anything to do with the fact that there is two key values? Please let me know.

Thanks,
Prince


Webfocus 8, All Outputs

 
Posts: 47 | Location: Atlanta, GA | Registered: June 09, 2011Report This Post
Master
posted Hide Post
Make sure that F_lookupstk has been created before the loop and that the formats of the fields are similar to the fields in the other stack. Then make sure that the other stack is populated. Finally make sure that you are running the code to populate F_lookupstk is issued before you try to display it.

If it still doesn't work please post your code.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Silver Member
posted Hide Post
I was about to post my code on here adn started deleting a bunch of comments that I had in place explaining what I was doing to myself. After deleting all the extra comments I had, It seems to be working! Maybe I had something there that was messing with something? Or I am guessing I had something extra in the code that I didn't notice before which I just deleted. Either way, It's working now!

Thanks everyone for the suggestions and help!


Webfocus 8, All Outputs

 
Posts: 47 | Location: Atlanta, GA | Registered: June 09, 2011Report 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] Maintain - Trying to copy data from one stack to another for REVISE

Copyright © 1996-2020 Information Builders