RDML for SET211S

LANSA

RDML for SET211S
* =======================================================
* Process ........: SET_211
* Function .......: SET211S
* Created on .....: 19/10/01 at 11:41:13
* Description ....: Function Skeleton
* Version.........: 1
*
* Full Description:
*
* This function shows a browselist
* with stock symbols of 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 submit a job to batch. This batch
* job will call the NASDAQ interface SET211Q
* and output a report.
*
* Disclaimer: The following material is supplied as an
* example only. No warranty is expressed or implied.
*
* ======================================================*
Function Options(*DIRECT)
*
Define Field(#MSGDTA) Type(*CHAR) Length(132)
* Store saved list name
Define Field(#LISTNAME) Type(*CHAR) Length(10)
* 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 (#S_211CDES *OUTPUT)) Counter(#LISTCOUNT)
*
Group_By Name(#PANELDATA) Fields(#S_211JOBQ)
*
Change Field(#S_211JOBQ) To(QBATCH)
*
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')
*
Request Fields(#PANELDATA) Browselist(#SHOWVALUE) Prompt_Key(*NO)
*
* Validate the jobq name
Exec_Os400 Command('Chkobj #S_211JOBQ *JOBQ') If_Error(ERR)
*
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, submit to batch a function
* which will access the Nasdaq stock inquiry service
* passing the NASD_SYMB working list and the NASDAQ
* Quotes working list that will be returned with the
* Stock information.
If Cond('#LISTCOUNT > 0')
Use Builtin(SAVE_LIST) With_Args(#NASD_SYMB 10 T 1) To_Get(#LISTNAME)
*
If Cond('#listname *ne *blanks')
Submit Process(SET_211) Function(SET211B) Exchange(#LISTNAME) Jobq(#S_211JOBQ)
Else
Message Msgtxt('Save_List Bif returned BLANK list name, please investigate')
Endif
Endif
*
Continue
*
ERR: Message Msgtxt('Invalid JOBQ Name')
End_Loop
*
Return
*
Subroutine Name(ADD_SHOWQ) Parms((#S_211VALU *RECEIVED) (#S_211CDES *RECEIVED))
Add_Entry To_List(#SHOWVALUE) With_Mode(*ADD)
Endroutine
*