View previous topic :: View next topic
|
Author |
Message |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Hi All,
I am coding one tool where I need to get the input from user and process as per the number of inputs , Currently I am using below Panel code
Code: |
)ATTR
! TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) CAPS(OFF)
# TYPE(TEXT) INTENS(HIGH) COLOR(WHITE)
^ AREA(DYNAMIC)
| AREA(SCRL) EXTEND(ON)
+ TYPE(TEXT) INTENS(HIGH) COLOR(WHITE) SKIP(ON)
% TYPE(TEXT) INTENS(HIGH) COLOR(BLUE) SKIP(ON)
{ TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) SKIP(ON)
$ TYPE(TEXT) INTENS(HIGH) COLOR(WHITE) SKIP(ON)
~ TYPE(TEXT) INTENS(HIGH) COLOR(YELLOW) SKIP(ON) HILITE(BLINK)
_ TYPE(INPUT) INTENS(HIGH) COLOR(RED)
@ TYPE(INPUT) INTENS(HIGH) COLOR(TURQ)
)BODY EXPAND(//)
% ~>>>>>>>>>RMS Agency File Deletion Tool>>>>>>>>>
%
~USER-{&ZUSER% -~SYSTEM- {&ZSYSID% -~DATE-{&ZDATE % -~TIME-{&ZTIM
%
%COMMAND ===>_XOPT
|XEFSCRL
)AREA XEFSCRL
$ ENTER BELOW THE PARAMETERS PASSED BY AGENCIES TO DELETE THE FILES:-
%
$ RCD =%Recovery Code $TIME=%Time of File$MIO =%MIO Code$Date=%Date of
$ AMT =%AMOUNT OF FILE $NOI =%NUMBER OF ITEMS
%
{RCD-01:_R1 {TIME01:_T1 {MIO01:_M1 {AMT01:_A1 { NOI01:_NI1
{RCD-02:_R2 {TIME02:_T2 {MIO02:_M2 {AMT02:_A2 { NOI02:_NI2
{RCD-03:_R3 {TIME03:_T3 {MIO03:_M3 {AMT03:_A3 { NOI03:_NI3
{RCD-04:_R4 {TIME04:_T4 {MIO04:_M4 {AMT04:_A4 { NOI04:_NI4
{RCD-05:_R5 {TIME05:_T5 {MIO05:_M5 {AMT05:_A5 { NOI05:_NI5
{RCD-06:_R6 {TIME06:_T6 {MIO06:_M6 {AMT06:_A6 { NOI06:_NI6
{RCD-07:_R7 {TIME07:_T7 {MIO07:_M7 {AMT07:_A7 { NOI07:_NI7
{RCD-08:_R8 {TIME08:_T8 {MIO08:_M8 {AMT08:_A8 { NOI08:_NI8
{RCD-09:_R9 {TIME09:_T9 {MIO09:_M9 {AMT09:_A9 { NOI09:_NI9
{RCD-10:_R10 {TIME10:_T10 {MIO10:_M10 {AMT10:_A10 { NOI10:_NI10
{RCD-11:_R11 {TIME11:_T11 {MIO11:_M11 {AMT11:_A11 { NOI11:_NI11
{RCD-12:_R12 {TIME12:_T12 {MIO12:_M12 {AMT12:_A12 { NOI12:_NI12
{RCD-13:_R13 {TIME13:_T13 {MIO13:_M13 {AMT13:_A13 { NOI13:_NI13
{RCD-14:_R14 {TIME14:_T14 {MIO14:_M14 {AMT14:_A14 { NOI14:_NI14
{RCD-15:_R15 {TIME15:_T15 {MIO15:_M15 {AMT15:_A15 { NOI15:_NI15
{RCD-16:_R16 {TIME16:_T16 {MIO16:_M16 {AMT16:_A16 { NOI16:_NI16
{RCD-17:_R17 {TIME17:_T17 {MIO17:_M17 {AMT17:_A17 { NOI17:_NI17
{RCD-18:_R18 {TIME18:_T18 {MIO18:_M18 {AMT9:-_A18 { NOI18:_NI18
{RCD-19:_R19 {TIME19:_T19 {MIO19:_M19 {AMT1:-_A19 { NOI19:_NI19
{RCD-20:_R20 {TIME20:_T20 {MIO20:_M20 {AMT2:-_A20 { NOI20:_NI20
{RCD-21:_R21 {TIME21:_T21 {MIO21:_M21 {AMT3:-_A21 { NOI21:_NI21
{RCD-22:_R22 {TIME22:_T22 {MIO22:_M22 {AMT4:-_A22 { NOI22:_NI22
{RCD-23:_R23 {TIME23:_T23 {MIO23:_M23 {AMT5:-_A23 { NOI23:_NI23
{RCD-24:_R24 {TIME24:_T24 {MIO24:_M24 {AMT6:-_A24 { NOI24:_NI24
{RCD-25:_R25 {TIME25:_T25 {MIO25:_M25 {AMT7:-_A25 { NOI25:_NI25
{RCD-26:_R26 {TIME26:_T26 {MIO26:_M26 {AMT8:-_A26 { NOI26:_NI26
{RCD-27:_R27 {TIME27:_T27 {MIO27:_M27 {AMT9:-_A27 { NOI27:_NI27
/-/
)PROC
IF (.PFKEY = PF03)
&pfkey = 3
/*RESP = ENTER */
)END |
One row is one input record , there may be multiple records say 10 or 20 .. I have to get those values in my program and process .. I am wondering if we have a way to use any generic variable and put the panel in loop or some thing which reduces this above code and my code as well .
Any suggestions are greatly appriciated...thanks |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Use a table display instead of a common panel. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks !!
I am not familier with tbdispl .. Can I use tbdispl for getting the input f rom user when I do not have any outdata to display there in the panel?
I tried to check few examples here in my shop but couldn't find any which is only and only taking input from user and then processing..
Could you please suggest?
trying manual as well but till now cant find the way
Thanks |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Code: |
/* REXX */
address ispexec
"libdef ispplib dataset id('AAA.BBB.panels') stack"
"control errors return"
"addpop row(1) column(2)"
"display panel(numbr)"
if pfkey = 3 then do
zedlmsg ='you have pressed pf3 key .. exiting the tool'
address ispexec "setmsg msg(isrz001) "
exit
end
if rc <> 0 then do
zedlmsg ='there is some problem with the tool,please contact
XXXXXXXXX to correct the problem and run the tool
again .please delete the file manually as of now'
address ispexec "setmsg msg(isrz001) "
exit
end
"ispexec rempop"
"libdef ispplib"
/* address ispexec "tbend" data */
max_numbr = n1 /* total number of iteration we need */
address ispexec "tbcreate" data,
"names(rcd rcode rmi rmio rtm rtime ritm ritems ramt ramonut) nowrite
replace"
if rc > 0 then say 'rc is not 0 11'
address ispexec
"libdef ispplib dataset id('AAAAA.panels') stack"
"control errors return"
"addpop row(1) column(2)"
do i = 1 to max_numbr
rcd = R.i
rmi = mi.i
rtm = ti.i
ritm =it.i
ramt = am.i
ADDRESS ISPEXEC "TBADD" DATA,
"SAVE(RCD RCODE RMI RMIO RTM RTIME RITM RITM RITEMS RAMT RAMONUT)"
if rc > 0 then call rc_check('A')
end
do until exitflg='y'
address ispexec "tbtop" data
if rc > 0 then say 'rc is not zero 1'
address ispexec "tbdispl" data "panel(multiple)"
if rc <> 0 then say 'rc is not zero in 34'
exit |
I got some idea now and tryin to execute above code to populate my scrollable panel with the value where user can enter their inputs but at the below line I am getting RC=20
Code: |
address ispexec "tbdispl" data "panel(multiple)" |
Any suggestion please
Many Thanks in advance !! |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
It started abending in
|
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
All my previous queries are solved and I am able to run the above code .. but now Have one more question
I cant scroll the tbdispl panel .. when I am entering the data in the panel and rows are more than current screen then I cant scrolit ..I seen the manual and came to know that scrolling is not supported in TBDISPL
Is there any way to scroll the data in TBDISPL |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I believe you simply assign the scroll up/down commands to your scroll up/down keys - usually F7 & F8. #by default these are not ssigned when using tables. |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Keys setting is right I think It says up for PF7 and Down for PF8 same for PF19 and PF20 respectively...
Do you mean that I need to set the PF keys by any other way or in Panel code?
Please suggest |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Below is my code whihc I am using
Code: |
max_numbr = n1
address ispexec "tbcreate" data,
"names(rcd rcode rmi rmio rtm rtime ritm ritems ramt ramonut) nowrite
replace"
if rc > 0 then say 'rc is not 0 11'
address ispexec
"libdef ispplib dataset id('test.user.panels') stack"
/* "control errors return" */
"addpop row(1) column(2)"
do i = 1 to max_numbr
rcd = r.i || '-'
rmi = mi.i || '-'
rtm = ti.i || '-'
ritm =it.i || '-'
ramt = am.i || '-'
address ispexec "tbadd" data,
"save(rcd rcode rmi rmio rtm rtime ritm ritems ramt ramonut)"
if rc <> 0 then call rc_check('a')
end
address ispexec "tbtop" data
if rc > 0 then say 'rc is not zero 1' rc
address ispexec "tbdispl" data "panel(multiple)"
zedsmsg =' '
ztdlrows = max_numbr
if rc > 8 then say 'rc is more then 8 ' rc
if varkey1 = 'PF03' then exit
data1 = ztdsels+0 /* */ |
)
Code: |
ATTR
! TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) CAPS(OFF)
# TYPE(TEXT) INTENS(HIGH) COLOR(WHITE)
^ AREA(DYNAMIC)
+ TYPE(TEXT) INTENS(HIGH) COLOR(WHITE) SKIP(ON)
% TYPE(TEXT) INTENS(HIGH) COLOR(BLUE) SKIP(ON)
{ TYPE(TEXT) INTENS(HIGH) COLOR(GREEN) SKIP(ON)
$ TYPE(TEXT) INTENS(HIGH) COLOR(WHITE) SKIP(ON)
~ TYPE(TEXT) INTENS(HIGH) COLOR(YELLOW) SKIP(ON) HILITE(BLINK)
_ TYPE(INPUT) INTENS(HIGH) COLOR(RED)
@ TYPE(output) INTENS(HIGH) COLOR(TURQ)
)BODY
% ~>>>>>>>>>RMS Agency File Deletion Tool>>>>>>>>>
%
~USER-{&ZUSER% -~SYSTEM- {&ZSYSID% -~DATE-{&ZDATE % -~TIME-{&ZTIM
%
%
+Command ===>_Z !Scroll===>_ZSCR
+ +
$ ENTER BELOW THE PARAMETERS PASSED BY AGENCIES TO DELETE THE FILES:-
%
$ RCD =%Recovery Code $TIME=%Time of File$MIO =%MIO Code$Date=%Date of F
$ AMT =%AMOUNT OF FILE $NOI =%NUMBER OF ITEMS
%
% REC-CODE MIO TIME-OF-FILE NUM-OF-ITEMS AMOUNT-OF-FILE
# ------- --- ------------ ------------ ---------------
)MODEL ROWS(ALL)
@Z _Z +@Z _Z +@Z +_Z +@Z +_Z +@Z +_Z
)INIT
.ZVARS = '(CMD RCD RCODE RMI RMIO RTM RTIME RITM RITEMS RAMT RAMOUNT)'
&ZWINTTL = 'RECOVERY MANAGEMENT SYSTEM'
&ZSCR = 'CSR'
&CMD = ' '
.CSRROW = 1
.AUTOSEL = NO
.CURSOR = RCODE
PROC
VER (&RCODE,NONBLANK,INCLUDE,IMBLK,ALPHAB,NUM)
VER (&RMIO,NONBLANK,INCLUDE,IMBLK,ALPHAB,NUM)
VER (&RTIME,NONBLANK,STDTIME)
VER (&RITEMS,NONBLANK,NUM)
VER (&RAMOUNT,NONBLANK,ENUM)
&VARKEY1=.PFKEY
IF (&ZCMD = 'PF3' 'CAN' 'CANCEL' 'END' 'EXIT')
REFRESH(*)
)END |
|
|
Back to top |
|
|
|