Hello,
My NAB built application calls a SQLRPG program via the app behaviors. The RPG program calls another program that will build a QTEMP file. It will then run a SQL statement that will select data from the QTEMP file and other joined files. I need the results of the SQL select statement to be displayed back in the Valence app and then be available for CSV download.
I built the SQLRPG program using the EXNABBTN sample as a te,mplate. It uses vvIn_num and vvIn_char to retrieve the input parms from app filters and variables.
Since all Valence grid widgets must be children of Valence data sources I'm not sure where the results from the called SQLRPG program can be displayed. Do I create a shell data source and widget or use some other type of object to receive and display the results?
I see that the tools in
http://service.cnxcorp.com/valence-6...ce_RPG_Toolkit
have many options for receiving the results. I'm not sure which procedure to use in this app.
Here is part of the code in the SQLRPG program
p Process b
d pi
/Free
CurDate = %Date();
CurTime = %Time();
CloseYr = vvIn_num('CloseYear');
CloseMo = vvIn_num('CloseMonth');
Company = vvIn_char('Company');
PlantArea = vvIn_char('PlantArea');
CsType = getAppVar('CostSheetType');
PrtSeq = getAppVar('PrintSequence');
// Build AVAZCPP in qtemp
AVE2XFR(RetCode:CloseYr:Company:PlantArea:CloseMo: CsType:PrtSeq);
When called from Valence "test RPG call" the SQLRPG program calls AVE2XFR and it runs, but the app receives message "API Error. Communication Error"
When I comment out the call to AVE2XFR and uncomment the following vvOut_data function and call the SQLRPG program via test RPG call I receive message API Error Encountered. Internal Server Error.
// send back a response...
//
vvOut_data('Send this text to the browser');
I don't understand how to use the functions in the RPG tool kit to receive results from the called SQLRPG program.
I have ctl-opt bnddir('VVSRVPGM') specified in the control spec.
I tried to add VVDSPECS copy source as specified in the tool kit general instruction, but the program compile fails when I do that.
I would appreciate your help and guidance.
Larry
Capture 1.PNG
My NAB built application calls a SQLRPG program via the app behaviors. The RPG program calls another program that will build a QTEMP file. It will then run a SQL statement that will select data from the QTEMP file and other joined files. I need the results of the SQL select statement to be displayed back in the Valence app and then be available for CSV download.
I built the SQLRPG program using the EXNABBTN sample as a te,mplate. It uses vvIn_num and vvIn_char to retrieve the input parms from app filters and variables.
Since all Valence grid widgets must be children of Valence data sources I'm not sure where the results from the called SQLRPG program can be displayed. Do I create a shell data source and widget or use some other type of object to receive and display the results?
I see that the tools in
http://service.cnxcorp.com/valence-6...ce_RPG_Toolkit
have many options for receiving the results. I'm not sure which procedure to use in this app.
Here is part of the code in the SQLRPG program
p Process b
d pi
/Free
CurDate = %Date();
CurTime = %Time();
CloseYr = vvIn_num('CloseYear');
CloseMo = vvIn_num('CloseMonth');
Company = vvIn_char('Company');
PlantArea = vvIn_char('PlantArea');
CsType = getAppVar('CostSheetType');
PrtSeq = getAppVar('PrintSequence');
// Build AVAZCPP in qtemp
AVE2XFR(RetCode:CloseYr:Company:PlantArea:CloseMo: CsType:PrtSeq);
When called from Valence "test RPG call" the SQLRPG program calls AVE2XFR and it runs, but the app receives message "API Error. Communication Error"
When I comment out the call to AVE2XFR and uncomment the following vvOut_data function and call the SQLRPG program via test RPG call I receive message API Error Encountered. Internal Server Error.
// send back a response...
//
vvOut_data('Send this text to the browser');
I don't understand how to use the functions in the RPG tool kit to receive results from the called SQLRPG program.
I have ctl-opt bnddir('VVSRVPGM') specified in the control spec.
I tried to add VVDSPECS copy source as specified in the tool kit general instruction, but the program compile fails when I do that.
I would appreciate your help and guidance.
Larry
Capture 1.PNG
Comment