Re: How to pass in arguments from unix script to INFORMIX 4GL program
Posted in 2006
I don't understand why your trying to make this so complicated..
script :
# sometab : create table sometab (pid integer,col1 char(10),col2 char(20));
echo "insert into sometable values($$,'xx1','yy1')" | dbaccess somedb -
echo "insert into sometable values($$,'xx2','yy2')" | dbaccess somedb -
echo "insert into sometable values($$,'xx3','yy3')" | dbaccess somedb -
# rds :
fglgo someprog $$
# c4gl/aubit
someprog $$
someprog.4gl
main
define lv_arr array[200] of record
x char(10),
y char(20)
end record
define lv_cnt integer
define lv_pid integer
let lv_pid=arg_val(1)
let lv_cnt=1
declare c1 cursor for
select col1,col2 from sometab where pid=lv_pid
foreach c1 into lv_arr[lv_cnt].*
let lv_cnt=lv_cnt+1
end foreach
let lv_cnt=lv_cnt-1
call set_count(lv_cnt)
input array ...
On Friday 05 May 2006 07:56, Mike Aubury wrote:
> If it were me - I'd load a table in the database with the values, probably
> using the process ID of the script as a key.
> Then pass that process ID into the 4gl program where it looks those values
> up...
>
> On Friday 05 May 2006 07:51, yy4 wrote:
> > Let me explain the background of my problem before I post any question:
> >
> > I have a few programs as below:
> >
> > Program id: onkey.4gh
> > --------------------------------
> > ....
> > ....
> > on key (F8) let g_onkey = 8
> > ....
> >
> >
> > Program id: hotkeys.h
> > ------------------------------
> > ....
> > #define F8_KEY 8
> > .....
> >
> > Main Program id: Prog.4gl
> > -------------------------------------
> > #include hotkeys.h
> >
> > Function input_scr()
> > display form
> >
> > input array arr1 without defaults from sa_arr1
> > ......
> > .....
> > #include "onkey.4gh"
> > case
> > when (g_hotkey = F8_KEY)
> > call generate_rpt()
> > end case
> > ......
> > End Function
> >
> >
> > Problem:
> > ------------
> > I wish to automate this INFORMIX 4GL program by passing in the input
> > values as an arguments from a calling unix scripts.
> >
> > The sequence INFORMIX 4GL screen input will be as below:
> > 1. enter screen array with 2 fields - account No, account name
> > e.g of the input screen will be
> >
> > Account No Account Name
> > [A ] [A/C Name A]
> > [B] [A/C Name B]
> > [C] [A/C Name C]
> >
> > 2. press F8 ctrl-key to generate the report
> >
> > My unix script (korn shell) will be something as below:
> > ksh -c "echo <array input value><F8 ctrl-key> |/proj/prog.exe " << ^M
> > !
> >
> > Note: /proj/prog.exe is my INFORMIX-4GL executable.
> >
> > Question:
> > 1. How to pass in a set of <array input value> from the scripts to an
> > informix 4GL program?
> > 2. The input array are optional, user can enter value in the array or
> > just leave the entry empty and press F8 to proceed with the process. In
> > this case, how to pass in an empty array values from a unix script (korn
> > shell) to an Informix-4GL program?
> >
> > I am facing this problem and need resolution urgently, please.
> >
> > I will be glad if anyone can help me on this issue.
> > Thanks in advacne.
> > _______________________________________________
> > Informix-list mailing list
> > Informix-list@iiug.org
> > http://www.iiug.org/mailman/listinfo/informix-list
--
Mike Aubury