Focal Point
Set a variable in MODIFY and access it outside

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

August 23, 2003, 06:46 PM
<Tennisbum>
Set a variable in MODIFY and access it outside
I am performing a database update using
MODIFY and CASE logic.
Is there any way I can set a variable in MODIFY
if some event happen?
I'd like to check that value upon exiting the
MODIFY.
In the code snippet, that value would be set in
case SET_VALUE.


VMS FILEDEF ...IN_DATA ..
-RUN

MODIFY FILE MASTE

CASE DO_IT
..
PERFORM SET_VALUE
...
ENDCASE
...

CASE case1
...
ENDCASE

CASE SET_VALUE
...
ENDCASE

CASE case2
...
ENDCASE

DATA ON IN_DATA
END
-RUN
-* Check value set here
August 25, 2003, 04:21 PM
Chris Boylan
You can use the "TYPE ON DDNAME" command within the MODIFY to type anything you like into an external file. Then use -READ to read the value from the file after the MODIFY completes. Does this do what you need?

-CB
August 26, 2003, 10:10 AM
Mikel
As Chris said:



FILEDEF FDATA ...
FILEDEF MODOUTF ...
-RUN

MODIFY FILE TBDWT004
PERFORM PROCESS
PERFORM MODOUT

CASE PROCESS
...
COMPUTE MENSAJE/A64 = 'My message' ;
...
ENDCASE

CASE MODOUT
TYPE ON MODOUTF " ***"
ENDCASE

DATA ON FDATA
END
-RUN

-READ MODOUTF &MESSAGE.A64.
-IF &IORETURN ...
Same in Maintain.

This message has been edited. Last edited by: <Mabel>,
August 28, 2003, 05:21 AM
<Tennisbum>
Thank you all. That helps