View previous topic :: View next topic |
Author |
Message |
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Mar 03, 2004 8:21 am Post subject: Displaying dyanamic panel |
|
|
I have a requirement where I am dyanamically creating changing the panel body. First one is coming properly but later ones are not generated. It always shows the first.
This is what I am using to acheive this -
Code: |
do q = 1 to que.0
/* redefine the panel here
...
*/
address ispexec
"libdef ispplib dataset id('"dataset"')"
"control display lock"
"display panel("pan_name")"
end
|
Thanks,
DIba. |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed Mar 03, 2004 9:37 pm Post subject: |
|
|
You need to include the whole rexx otherwise how are we to know whether the problem lies in you redefine code or not?
You shouldn't put a libdef in a loop - it is unnecessary.
If you are including rexx variables to display on your panel - remember to include them inside the quotes as the variable name otherwise the variable will be evaluated and the result written to the panel will be the value of the variable not the variable itself. The panel will then try to display the value of the value, as it were.
Here is an example that does what you seem to want (blink and you'll miss it):-
Code: |
/* REXX */
dataset = "TEMP.PANEL"
if sysdsn(dataset) <> "OK" then
"ALLOC DA("dataset"(TMPPANEL)) FI(PANSRC) NEW",
"DSORG(PO) RECFM(F B) LRECL(80) SPACE(10 10) CYL DIR(10)"
else
"ALLOC DA("dataset"(TMPPANEL)) FI(PANSRC) SHR REUSE"
address ispexec
"LIBDEF ISPPLIB DATASET ID("dataset")"
do q = 1 to 50
queue ")ATTR"
queue " $ TYPE(TEXT) INTENS(HIGH) COLOR(YELLOW)"
queue " ~ TYPE(OUTPUT) INTENS(HIGH) COLOR(BLUE)"
queue ")BODY"
queue " "
queue "$This is panel number ~Q"
queue " "
queue ")INIT"
queue ")END"
queue ""
address tso "execio * diskw pansrc (finis"
"CONTROL DISPLAY LOCK"
"DISPLAY PANEL(TMPPANEL)"
end
"LIBDEF ISPPLIB DATASET"
|
_________________ My opinions are exactly that. |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Wed Mar 03, 2004 9:58 pm Post subject: |
|
|
Diba,
it's only a guess (I'm off home soon so haven't got the time to check it out). But perhaps, if the dataset is always the same one, then the LIBDEF doesn't reallocate the dataset. Try issuing the LIBDEF without the dataset parameter to release the LIBDEF'd dataset. As I said it's only a guess. _________________ Regards,
Mike. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Mar 04, 2004 1:59 am Post subject: |
|
|
Mike,
I was having similar problem when I was manually changing the panel. LIBDEF without dataset solved the problem. But I am having same problem when I am changing it thru a program.
Maton Man,
I didn't put complete code because I felt that problem is with some ISPEXEC commands. I am providing complete code now. Basic idea is to display the same panel repetitively, line by line, so that it appears to scroll down.
Code: |
create_panel:
pan_name = prob001p; dataset = userid()"."pan_name
que.1 = ")BODY CMD(ZCMD)"
que.2 = " +D%I+B%A+K%A+R %W+O%R+K%B+E%N+C%H"
que.3 = "+COMMAND ===>_ZCMD"
que.4 = ""
que.5 = "+ENTER MEMBER NAMES ===>_PROGS"
que.6 = ")END"
que.0 = 5; que_last = que.0 + 1
if sysdsn("'"dataset"'") <> OK then
"alloc da('"dataset"') new delete dir(1) track unit(sysda)
space(2 1) recfm(f b) lrecl(80) blksize(3120)"
"alloc fi("pan_name") da('"dataset"("pan_name")') shr reuse"
do q = 2 to que.0
address tso
"execio "q" diskw "pan_name" (stem que."
push que.que_last
"execio 1 diskw "pan_name" (finis"
address ispexec
"libdef ispplib"
"libdef ispplib dataset id('"dataset"')"
"control display lock"
"display panel("pan_name")"
end
return |
Thanks,
DIba. |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Thu Mar 04, 2004 5:07 pm Post subject: |
|
|
Diba,
I been having a bit of a play, basically I think the problem is the same one that requires you to logoff (come out of ISPF unless in dialog test) after you have changed a panel. I think ISPF knows that it's used this panel and therefore uses the previously processed version (uhhm wonder if you pre-processed it with ISPPREP within the program). I don't think that there's any easy way around this other than to use other member/dataset names. _________________ Regards,
Mike. |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Thu Mar 04, 2004 5:22 pm Post subject: |
|
|
Diba,
here's the code I used for testing (added stuff to show what was going on plus tried freeing datasets and other things).
Code: |
create_panel:
count = 0
pan_name = prob001p; dataset = userid()".USER.TSTPNL"
que.1 = ")BODY CMD(ZCMD)"
que.2 = "+ &Q +D%I+B%A+K%A+R %W+O%R+K%B+E%N+C%H &COUNT"
que.3 = "+COMMAND ===>_ZCMD"
que.4 = " "
que.5 = "+ENTER MEMBER NAMES ===>_PROGS"
que.6 = ")END"
que.0 = 5; que_last = que.0 + 1
if sysdsn("'"dataset"'") <> OK then
"alloc da('"dataset"') new delete dir(1) track unit(sysda)
space(2 1) recfm(f b) lrecl(80) blksize(3120)"
do q = 1 to 5
que.4 = "+"Left("",q * 5,"$")
address tso
"ALLOC F("pan_name") DA('"dataset"("pan_name")') SHR"
"execio * diskw "pan_name" (stem que. FINIS"
"FREE F ("pan_name")"
address ispexec
"libdef ispplib"
"libdef ispplib dataset id('"dataset"')"
Do i = 1 to 10
"control display lock"
"display panel("pan_name")"
count = count + 1
End
end
return
|
_________________ Regards,
Mike. |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Thu Mar 04, 2004 5:36 pm Post subject: |
|
|
Diba,
one last thought, perhaps, if it's possible, you could invoke ISPF test mode before each display (don't know how to do this within a program though). _________________ Regards,
Mike. |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Thu Mar 04, 2004 8:02 pm Post subject: |
|
|
Now that I know what you're trying to do, try this:
Code: |
/* REXX */
panel_line.1 = "$ +D%I+B%A+K%A+R %W+O%R+K%B+E%N+C%H &i"
panel_line.2 = " "
panel_line.3 = "+ENTER MEMBER NAMES ===>_PROGS"
panel_line.4 = " "
panel_line.5 = "$ +D%I+B%A+K%A+R %W+O%R+K%B+E%N+C%H &i"
panel_line.6 = " "
panel_line.0 = 6
dataset = "TEMP.PANEL"
if sysdsn(dataset) <> "OK" then
"ALLOC DA("dataset"(TMPPANEL)) FI(PANSRC) NEW",
"DSORG(PO) RECFM(F B) LRECL(80) SPACE(10 10) CYL DIR(10)"
else
"ALLOC DA("dataset"(TMPPANEL)) FI(PANSRC) SHR REUSE"
address ispexec
do i = 1 to panel_line.0
"LIBDEF ISPPLIB DATASET ID("dataset")"
queue ")BODY"
queue "+COMMAND ===>_ZCMD"
do j = 1 to i
queue panel_line.j
end
queue ")END"
queue ""
address tso "execio * diskw pansrc (finis"
do k = 1 to 100000;end /* Slows the screen refresh down */
"CONTROL DISPLAY LOCK"
"CONTROL DISPLAY REFRESH"
"DISPLAY PANEL(TMPPANEL)"
"LIBDEF ISPPLIB DATASET"
end
|
_________________ My opinions are exactly that. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Fri Mar 05, 2004 7:53 am Post subject: |
|
|
It's still not working.
Probably I have to concentrate on some productive work now.
Thanks,
Diba. |
|
Back to top |
|
|
JimFennerCanberra Beginner
Joined: 15 Mar 2004 Posts: 1 Topics: 0 Location: Australia
|
Posted: Mon Mar 15, 2004 3:08 am Post subject: |
|
|
Hi Dibakar,
Surf to my website www.jimfenner.com
and download rexx code and panel that make Scrolling ISPF Progress displays a snap.
Any long-running Rexx will benefit from them.
Notes:
-Use Internet Explorer or Opera if you want to see a working Javascript-based demo of what you get. (I can't get the demo working under Mozilla - anyone care to help?)
-Email me at jim@jimfenner.com if you have trouble downloading the rexxes and panel. _________________ Jim |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Wed Mar 17, 2004 12:37 am Post subject: |
|
|
Hi Jim,
I will try this out.
Thanks,
Diba. |
|
Back to top |
|
|
|
|