Focal Point
[SOLVED] How to transfer data from one MAINTAIN Procedure to other???

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6757052576

March 23, 2015, 08:58 AM
Shubhi
[SOLVED] How to transfer data from one MAINTAIN Procedure to other???
Hi,

Please can any one help me in transferring data from one maintain procedure(.mnt) to another(.mnt) in the same project in Update records case.

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7, 8
Windows, All Outputs
March 23, 2015, 12:21 PM
Alan B
At which point, or from where, are you wanting to call another maintain process and pass parameters?


Alan.
WF 7.705/8.007
March 23, 2015, 01:55 PM
Maintain Wizard
The Maintain command to have one Maintain perform another Maintain is CALL. You can CALL one Maintain from another and pass stacks of data between them. You just have to remember to INFER the stack in the CALLd Maintain. An example would be:

-* Maintain1
MAINTAIN FILE Movies
For ALL Next Moviecode into MOVSTK
CALL Maintain2 from MOVSTK
END

-Maintain2
MAINTAIN FILE Movies from MOVSTK
Infer Moviecode into MOVSTK
-* Now you can use the data that was loaded into the MOVSTK in Maintain1
END

Mark
March 24, 2015, 02:00 AM
Shubhi
Thank you for your response Mark..

Let me try and if there is any problem I will let you know..

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


WebFOCUS 7, 8
Windows, All Outputs
March 24, 2015, 02:46 AM
Shubhi
Hey Mark,

its wrk...

Now,How we can call multiple stacks from one maintain procedure using CALL statement...


WebFOCUS 7, 8
Windows, All Outputs
March 24, 2015, 05:42 AM
Alan B
This is in the training course and in the manuals. You should have training and you should read the manuals. In the base form:

CALL Maintain_procedure [AT server] [KEEP|DROP] [PATH {VAR|LIST}] [FROM var_list] [INTO var_list] [;]


You can CALL from multiple stacks and simple variables.

The items that MUST match in the call and receiving Maintain Commands:
Number of items
Sequence of items
Data Types
Stack Column Names

The items that need not match:
Stack and variable names
Length and precision

If a single Stack cell is passed, it must be received as a simple variable.
You cannot pass variables or stacks using A0 or Stack of formats.
Stacks and variables can be passed back using the INTO option, FROM Stacks and variables are not passed back and remain unchanged in the host process.


Alan.
WF 7.705/8.007
March 24, 2015, 08:34 AM
Maintain Wizard
So, as Alan points out, multiple stacks can be passed to and from a CALL'd procedure from the parent. Just list them on the CALL command line...


-* Maintain1
MAINTAIN FILE Movies
For 10 Next Moviecode into MOVSTK1
For 10 Next Moviecode into MOVSTK2
For 10 Next Moviecode into MOVSTK3

CALL Maintain2 from MOVSTK1 MOVSTK2 MOVSTK3
END

-Maintain2
MAINTAIN FILE Movies from MOVSTK1 MOVSTK2 MOVSTK3
Infer Moviecode into MOVSTK1
Infer Moviecode into MOVSTK2
Infer Moviecode into MOVSTK3
-* Now you can use the data that was loaded into the MOVSTK1, NOVSTK2 and MOVSTK3 in Maintain1
END

Mark
March 25, 2015, 02:50 AM
Shubhi
Thank u Alan and Mark...

it really helps.. but can we use multiple data source for transferring data into multiple stacks.Fro ex-


-* Maintain1
MAINTAIN FILE Movies Car


so, here car is the other data source.
How can we put both the data source into the stacks at the same time .


WebFOCUS 7, 8
Windows, All Outputs
March 25, 2015, 07:53 AM
Alan B
Please check out the manuals and take training.

A simple stack can contain data from any single source.

All you have to do is try.


Alan.
WF 7.705/8.007
March 25, 2015, 09:25 AM
Maintain Wizard
I absolutely agree with Alan that taking Maintain training is the best way to learn how to use the product. Having said that, you can use up to 15 different data sources with the Maintain product. Each stack can contain one database path. So...

-* Maintain1
MAINTAIN FILE Movies AND CAR
For 10 Next Moviecode into MOVSTK1
For ALL Next Country Car into CARSTK1

CALL Maintain2 from MOVSTK1 CARSTK1
END

-Maintain2
MAINTAIN FILE Movies AND CAR from MOVSTK1 CARSTK1
Infer Moviecode into MOVSTK1
Infer Country Car into CARSTK1
-* Now you can use the data that was loaded into the MOVSTK1 and CARSTK1 in Maintain2
END

Mark