Passing parameters to 4GL file from shell script
Posted in 2009
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi Please help me out for solving this problem. I want to execute a shell script and user will input a value for a variable. Let's say user will input the value "ABC". Then I want to call a 4GL file and pass the parameter "ABC" to the 4GL file. How we can achieve the same? Can we pass parameters to 4GL files in this way? Really appreciate your help. Thanks Nirmalya
Actually you can use arg_val parameters, for example: define g_user char(8) . . . let g_user = arg_val(1) So g_user variable content will be the first argument passed during the program call. If you desire more parameters, add them on the program call, separating with spaces, and add more variables on the program (arg_val(1), (2), and so on...) I hope this solves your question... Regards. Alexandre Marini Analista de Tecnologia da Informação - DBA msn: alexandre_marini@hotmail.com SEFAZ-MS / UIMP / Sistemas: Fronteiras e SIG-DW NIRMALYA SINHA escreveu: > Hi > > Please help me out for solving this problem. > > I want to execute a shell script and user will input a value for a variable. > Let's say user will input the value "ABC". Then I want to call a 4GL file and > pass the parameter "ABC" to the 4GL file. How we can achieve the same? > > Can we pass parameters to 4GL files in this way? Really appreciate your help. > > Thanks > Nirmalya > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > > >
Try arg_val(n) where n is the location of the argument you are passing. This function will return the argument at location n -Michael On Fri, May 29, 2009 at 7:20 AM, NIRMALYA SINHA < nirmalyasinha@alcatel-lucent.com> wrote: > Hi > > Please help me out for solving this problem. > > I want to execute a shell script and user will input a value for a > variable. > Let's say user will input the value "ABC". Then I want to call a 4GL file > and > pass the parameter "ABC" to the 4GL file. How we can achieve the same? > > Can we pass parameters to 4GL files in this way? Really appreciate your > help. > > Thanks > Nirmalya > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- ******************************************** Michael A. Mason www.masonfamilyonline.com ******************************************** --0016e644d5e0106e1b046b0bbaf4
There are several ways to do this. See the Informix 4GL Reference manual for the ARG_VAL() and NUM_ARGS() functions to access commandline arguments. An alternative would be to export the environment variable and access it directly using the flg_getenv() function. Art Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Fri, May 29, 2009 at 7:20 AM, NIRMALYA SINHA < nirmalyasinha@alcatel-lucent.com> wrote: > Hi > > Please help me out for solving this problem. > > I want to execute a shell script and user will input a value for a > variable. > Let's say user will input the value "ABC". Then I want to call a 4GL file > and > pass the parameter "ABC" to the 4GL file. How we can achieve the same? > > Can we pass parameters to 4GL files in this way? Really appreciate your > help. > > Thanks > Nirmalya > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001636c5b8efe2fb4b046b2d916d