RDML for SET211G

LANSA

RDML for SET211G
* =======================================================
* Process ........: SET_211
* Function .......: SET211G
* Created on .....: 19/10/01 at 11:41:13
* Description ....: Function Skeleton
* Version.........: 1
*
* Full Description:
*
* This function shows a browselist
* with stock symbols for 5 popular NASDAQ stocks:
* IBM (IBM), Microsoft (MSFT), Sun Microsystems (SUNW),
* Apple Computers (AAPL) and Compaq (CPQ).
* You can overwrite any of these symbols by typing over
* them. Press enter to call the NASDAQ interface SET211Q
* and obtain the stock prices from the NASDAQ service.
* The stock symbols are passed in the working list
* #NASD_SYMB.
*
* Disclaimer: The following material is supplied as an
* example only. No warranty is expressed or implied.
*
* ======================================================*
Function Options(*DIRECT)
*
* Working list to pass the symbols to NASDAQ interface
Def_List Name(#NASD_SYMB) Fields(#S_211VALU) Type(*WORKING)
* Browselist to type in the Stock symbol
Def_List Name(#SHOWVALUE) Fields((#S_211VALU *P17) (#S_211CDES *P28 *OUTPUT)) Counter(#LISTCOUNT)
*
* Fields for outbound working list with NASDAQ quotes.
* This list is returned by JSM with the Stock quotes
Def_List Name(#NASQUOTES) Fields(#S_211ISSU #S_211THIG #S_211TLOW #S_211YHIG #S_211YLOW #S_211LAST) Type(*WORKING)
* Browselist to show the Stock quotes returned by NASDAQ
Def_List Name(#SHOWQUOTE) Fields((#S_211ISSU *P4) (#S_211THIG *P32) (#S_211TLOW *P41) (#S_211YHIG *P50) (#S_211YLOW *P59) (#S_211LAST *P68))
*
Clr_List Named(#NASQUOTES)
* Call SETJSMO to open JSM
Execute Subroutine(OP_CL_JSM) With_Parms(OPEN)
*
Begin_Loop
*
* Add quotes symbols of the stocks to inquire and display
* the browselist
*
Clr_List Named(#SHOWVALUE)
Execute Subroutine(ADD_SHOWQ) With_Parms(IBM 'Value Symbol of IBM Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(MSFT 'Value Symbol of Microsoft Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(SUNW 'Value Symbol of Sun Microsystems Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(AAPL 'Value Symbol of Apple Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(CPQ 'Value Symbol of Compaq Stock')
*
Display Browselist(#SHOWVALUE) Exit_Key(*YES CLS) Menu_Key(*YES CLS) Prompt_Key(*NO)
*
Clr_List Named(#NASD_SYMB)
*
* Select Stock symbols from browselist and add
* them to the Name-Value working list to pass to the
* NASDAQ interface.
Selectlist Named(#SHOWVALUE) Get_Entrys(*NOTNULL)
* Add input symbols to working list to exchange with
* NASDAQ interface
Add_Entry To_List(#NASD_SYMB)
*
Endselect
*
* If the list is non blank, call the NASDAQ
* interface function passing the NASD_SYMB working list
* and the NASDAQ Quotes working list that will be
* returned with the Stock information.
*
If Cond('#LISTCOUNT > 0')
Call Process(*DIRECT) Function(SET211Q) Exit_Used(*NEXT) Menu_Used(*NEXT) Pass_Lst(#NASD_SYMB #NASQUOTES)
*
* Add the working list entries into the browselist
* and show it.
Clr_List Named(#SHOWQUOTE)
Execute Subroutine(LOAD_QUOTE)
Display Browselist(#SHOWQUOTE) Exit_Key(*YES CLS) Menu_Key(*YES CLS) Prompt_Key(*NO)
*
Endif
*
End_Loop
*
* Close JSM
CLS: Execute Subroutine(OP_CL_JSM) With_Parms(CLOSE)
Return
*
*
Subroutine Name(LOAD_QUOTE)
* Select from the returned working list and add to
* the browselist. Where an invalid quote
* symbol was entered, alphanumeric fields are returned
* as blanks and numeric ones as zeros
Selectlist Named(#NASQUOTES)
Add_Entry To_List(#SHOWQUOTE) With_Mode(*DISPLAY)
Endselect
*
Endroutine
*
Subroutine Name(ADD_SHOWQ) Parms((#S_211VALU *RECEIVED) (#S_211CDES *RECEIVED))
Add_Entry To_List(#SHOWVALUE) With_Mode(*ADD)
Endroutine
*
Subroutine Name(OP_CL_JSM) Parms((#W_ACTION *RECEIVED))
Define Field(#W_ACTION) Type(*CHAR) Length(005)
Group_By Name(#S_EXCHFLD) Fields(#S_JSMSTS #S_JSMMSG #W_ACTION)
Exchange Fields(#S_EXCHFLD)
Call Process(*DIRECT) Function(SETJSMO) Exit_Used(*NEXT) Menu_Used(*NEXT)
Endroutine
*