ISPF DISPLAY Service returns RC=20



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

ISPF DISPLAY Service returns RC=20

Postby Quasar » Sun Jun 02, 2013 3:29 pm

Hi all,

I am trying to generate a panel on-the-fly, allocate a panel library, write the member to the library and LIBDEF it to ISPPLIB. When I issue the call to DISPLAY PANEL() service, it sets a return-code of 20. I am unable to understand, why the DISPLAY is failing. I tried searching on the Internet, but couldn't get much help. Could you give me some pointers, about what's wrong?

/*__________________________________________________________________*/ 
   Display_Dyn_Panel:                                                   
/* -----------------                                                */ 
/* This routine builds an ISPF Panel on the fly and displays it.    */ 
/*__________________________________________________________________*/ 
   ZPF07 = 'PREV'                                                       
   ZPF08 = 'NEXT'                                                       
   ZCMD  = ''                                                           
   ROW   = 0                                                           
   COL   = 0                                                           
                                                                       
   Call load_dynlib                                                     
   Call put_object                                                     
                                                                       
   Address ispexec "libdef ispplib library id("dynlib") stack"         
   SAY 'LIBDEF RC = ' RC                                               
                                                                       
   Address Ispexec "VPUT (ZPF07,ZPF08) PROFILE"                         
/* Say 'VPUT RC: ' RC                              */                   
   Address Ispexec "ADDPOP ROW(05) COLUMN(01)"                         
   IF RC > 0 THEN DO                                                   
      Say 'ADDPOP RC = ' RC                                             
      EXIT                                                             
   end                                                                 
   Address Ispexec "DISPLAY PANEL(DYNPANE)"                             
   Display_rc = rc                                                     
                                                                       
   IF DISPLAY_RC > 0 THEN DO                                           
      SAY 'DISPLAY PANEL RC = ' RC                                     
      EXIT                                                             
   END                                                                 
   Address ISPEXEC "REMPOP"                                             
                                                                       
/* SAY 'DISPLAY_RC : ' DISPLAY_RC                                   */ 
   RETURN                                                               
/*__________________________________________________________________*/ 
   load_dynlib:                                                         
/* -----------------                                                */ 
/* This routine queues the panel body, and then stores it in a mem. */ 
/*__________________________________________________________________*/ 
   dynlib = 'dyn'||random(99999)                                       
   tempds = USERID()|| '.ISPPLIB.TMP' ||random(9999)                   
   alloc_fi = "ALLOC FI ("dynlib") da('"tempds"')" ||,                 
           " lrecl(80) blksize(800)" ||,                               
           " new reu" ||,                                               
           " space(5,5) dir(10) "                                       
                                                                       
   ADDRESS TSO ""alloc_fi""                                             
                                                                       
                                                                       
   if rc = 0 then do                                                   
      ispdyn = tempds                                                   
   end                                                                 
   else do                                                             
      ispdyn = 'NOT FOUND'                                             
      Say 'Failed to allocated Dynamic Library'                         
      Say '//' || dynlib || ' DD DSN=' || tempds                       
      Say rc                                                           
      exit                                                             
   end                                                                 
                                                                       
   Address tso                                                         
   "newstack"                                                           
   member = 'DYNPANE'                                                   
   queue ')ATTR'                                                       
   queue '@ AREA(DYNAMIC) SCROLL(OFF)'                                 
   queue 'Y TYPE(CHAR) COLOR(TURQUOISE) HILITE(REVERSE)'               
   queue '~ TYPE(CHAR) COLOR(GREEN)'                                   
   queue '$ TYPE(DATAIN) COLOR(TURQUOISE) HILITE(REVERSE)'             
   queue '_ TYPE(NEF) PADC(_)'                                         
   queue '| TYPE(TEXT) COLOR(YELLOW)'                                   
   queue 'ยข TYPE(DATAOUT) COLOR(BLUE)'                                 
   queue '? TYPE(NT)'                                                   
   queue ')BODY WINDOW(76,12) CMD(ZCMD)'                               
   queue '|                        MINE - Structure Chart Generator' ||,
         '                  +'                                         
   queue '?                                                        ' ||,
         '                  +'                                         
   queue '+@DYNVAR,SHADVAR                                         ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue '+@                                                       ' ||,
         '                  @'                                         
   queue ')PROC'                                                       
   queue '&PFKEY=.PFKEY'                                               
   queue ')END'                                                         
                                                                       
   RETURN                                                               
/*__________________________________________________________________*/ 
   put_object:                                                         
/* ----------                                                       */ 
/* This routine stores the member into the Temporary ISPF Library   */ 
/* allocated previously.                                            */ 
/*__________________________________________________________________*/ 
   tfil = 'tfil' || random(9999)                                       
   Address tso                                                         
   "alloc f("tfill") da('"ispdyn"("member")') shr reu"                 
   if rc > 0 then do                                                   
      say 'Failed to allocate member, RC = ' rc                         
   end                                                                 
   Address tso                                                         
   "execio" queued() "diskw "tfill" (finis"                             
   "free f("tfill")"                                                   
   "delstack"                                                           
                                                                       
   RETURN                                                               
                                                                       
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Re: ISPF DISPLAY Service returns RC=20

Postby prino » Sun Jun 02, 2013 7:20 pm

You missed two things:

1) The fact that you "borrowed" this code from me
2) That there is no ZCMD field on the panel
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy

These users thanked the author prino for the post:
Quasar (Sun Jun 02, 2013 9:03 pm)
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: ISPF DISPLAY Service returns RC=20

Postby Quasar » Sun Jun 02, 2013 9:03 pm

Prino -

1. I may have missed it here, but haven't forgotten it. I haven't still uploaded this on CBTTape, but I am surely going mention the source in the comments-section. I liked the code so much and the fact it works at any shop, that I encourage friends, fellow programmers to use it. All credits to Robert Prino.
2. Gosh, thank you so much for that. It works now. I should have done a trace rather.

Thank you very much!
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Re: ISPF DISPLAY Service returns RC=20

Postby enrico-sorichetti » Sun Jun 02, 2013 9:54 pm

I haven't still uploaded this on CBTTape, but I am surely going mention the source in the comments-


pretty stupid intent ...
when somebody using Your upload will email about malfunctions, what are You going to do ?
ask on a forum how to fix it ? :mrgreen:

meditate, You were not even able to debug such a silly mistake.

and even if legally nothing might prevent You from doing it,
from an ethical point of view it will be still a pretty inconsiderate approach.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: ISPF DISPLAY Service returns RC=20

Postby Quasar » Mon Jun 03, 2013 12:16 am

Enrico,

Yeah, I should have. But, I have fixed a lot of issues with it upto now, even tried it at my shop. I get the point you are trying to make.

Thank you.
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post