how to include code

Hi,
I have an easy question...
My ksh script has a section with non ksh script in it - let's pretent it is VBA code. I need to include this vba script in my ksh script into so that my VBA script can be reused elsewhere by other ksh script by "$include" into other ksh scripts. What is the syntax - do you know? .

For example, instead of this original ksh script:

#!/bin/ksh

run VBA script
import database dimensions
from local text data_file 'sales_hierarchy.txt' using server rules_file 'sales2'
on error append to '.log';
end of run VBA script
exit

I want to break it into two. The first script:

#!/bin/ksh

$include vba.code

exit

my vba.code will have the VBA section:
run VBA script
import database dimensions
from local text data_file 'sales_hierarchy.txt' using server rules_file 'sales2'
on error append to '.log';
end of run VBA script
Thanks in advance
:smiley:

Do you mean the source operator "."?

As in

. /some/other/file.sh

VBA code in a Korn Shell.....?

Hi,
Yes, I did try to use . /some/other/file.vba but it does not execute. We use source operator "." for including ksh code, but it seems to not want to include vba code.
The source operator
. /apps/hyperion/test.vba
does not seem to work when it is in the middle of vba code.

I used VBA only as an example. I am really including not VBA code but Essbase's Maxl script. My ksh script executes a program that reads the maxl script and executes Essbase commands. I want to put some of that Maxl script in another file and include it in original file. Any other ideas?
Thanks.

I can't help without understanding how the program loads the maxl scripts.