Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ISPF - TBDELETE help to delete a row from a table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
epicdave

New User


Joined: 11 Oct 2007
Posts: 20
Location: New York

PostPosted: Wed Oct 24, 2007 9:07 pm    Post subject: ISPF - TBDELETE help to delete a row from a table
Reply with quote

Hi all,

I'm working on a project where I need to dynamically update a table displayed in an ISPF panel I've created. This updating is done depending on the position of the cursor when the command is issued. So for example, if the panel displays a table of information, and the user scrolls down to a line and executes a command, the table will be altered to display only some of the data.

I've got the table setup and the machine is able to determine where the cursor is and what rows of the table need to be deleted. My issue is with TBDELETE. The ISPF Reference Summary gives you
Quote:
TBDELETE—delete a row from a table

Command invocation format
-----------------------------------
ISPEXEC TBDELETE table-name

Call invocation format
---------------------------
CALL ISPEXEC (buf-len, buffer); OR CALL ISPLINK (’TBDELETE’, table-name); TBCLOSE service

Return codes
----------------
0 Normal completion.

8 Keyed tables: the row specified by the value in key variables does not exist; CRP set to TOP (zero). Non-keyed tables: CRP was at TOP (zero) and remains at TOP.

12 Table is not open.

20 Severe error.


which isn't very helpful icon_rolleyes.gif I understand that TBDELETE will remove the line of a table that the row pointer currently points to. I've tried setting the row pointer to the line(s) I need to delete but it doesn't seem to work.

Does anyone know how to specify which row(s) you want TBDELETE to delete?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Wed Oct 24, 2007 9:56 pm    Post subject:
Reply with quote

I do not know if it will help You, but here is a snippet of code that works

it updates the ispf command table reading from a file

if the verb is found it deletes the row and adds the new one
( easier then replace all the columns )


Code:

Do While ( getcmds() = 0 )                                 
   call  $ispex("TBTOP    ISPCMDS" )                       
   zrc = $ispex("TBSCAN   ISPCMDS ARGLIST(ZCTVERB) NOREAD ")
                                                           
   Select                                                   
      When zrc = 0 Then Do                                 
        call  $ispex("TBDELETE ISPCMDS ")                   
        call  $ispex("TBADD    ISPCMDS ")                   
      End                                                   
      When zrc = 8 Then Do                                 
        call  $ispex("TBADD    ISPCMDS ")                   
      End                                                   
      Otherwise do                                         
         zerrsm = left(_commnd,8)"- Table Error"           
         zerrlm = "Rc("zrc") Scanning table ISPCMDS"       
         zretc  = 4                                         
         call $term                                         
         exit                                               
      End                                                   
   End                                                     
                                                           
End                                                         


$ispex:                                                               
   trace "O"                                                           
   Address ISPEXEC arg(1)                                             
   isp_0rc = rc                                                       
   return isp_0rc                                                     
Back to top
View user's profile Send private message
epicdave

New User


Joined: 11 Oct 2007
Posts: 20
Location: New York

PostPosted: Sat Oct 27, 2007 1:07 am    Post subject: Reply to: ISPF - TBDELETE help to delete a row from a table
Reply with quote

I should have mentioned in my first post that using TBSCAN would have been problematic as the search string would have been numeric, and appears multiple times in each line of the table. My mentor came up with a useful bit of code that allows you to delete specific ranges of rows from a table, w/o having to start from the top and scan the whole thing. Below is a bit of sample code that demonstrates the function's capabilities:

Code:

/* REXX */
ADDRESS ISPEXEC                                                         
'TBCREATE EXTABLE KEYS(LINE) NAMES(EXA) NOWRITE'                       

/* ADD 25 ENTRIES TO TABLE  */

LINE = 1                                                               
DO UNTIL (LINE > 25)                                                   
  EXA = 'A'||LINE                                                       
  'TBADD    EXTABLE'                                                   
  'TBPUT    EXTABLE'                                                   
  'TBQUERY EXTABLE  ROWNUM(ROWS)'                                       
  LINE = LINE + 1                                                       
END                                                                     

/* DELETE LINES 6 THROUGH 10 */

CALL XTBD('6' '10')                                                     

/* DELETE LINES 13 AND 14 */

L1 =  13                                                               
L2 =  14                                                               
CALL XTBD(L1   L2)                                                     

/* DISPLAY WHAT IS IN TABLE NOW */

LINE = 1                                                               
DO UNTIL (LINE > 25)                                                   
  'TBGET    EXTABLE'                                                   
  IF (RC=0) THEN                                                       
    DO                                                                 
      SAY LINE EXA                                                     
    END                                                                 
  LINE = LINE + 1                                                       
END                                                                     
'TBEND   EXTABLE'                                                       

/* SUBROUTINE FOR DELETING LINES FROM TABLE */

XTBD:                                                                   
PARSE ARG FIRST LAST                                                   
LINE = FIRST                                                           
DO UNTIL (LINE > LAST)                                                 
  'TBDELETE  EXTABLE'                                                   
  LINE = LINE + 1                                                       
END                                                                     
RETURN                                                                 


I hope that helps anyone else who has the same issue, and as always, thank you for all your help!!

icon_biggrin.gif David
Back to top
View user's profile Send private message
AbuHaya

New User


Joined: 30 Jul 2008
Posts: 1
Location: Rochester, MN

PostPosted: Wed Aug 20, 2008 12:29 am    Post subject: Reply to: ISPF - TBDELETE help to delete a row from a table
Reply with quote

when calling the table to display, give a variable for the row number

Like this:
Code:
address ISPEXEC "TBDISPL <TableName> PANEL(<PanelName) ROWID(rowloc)"




when deleting, "rowloc" will return the row the user choose

Like this:
Code:
Address ISPEXEC "TBDELETE <TableName> ROWID(rowloc)"
Back to top
View user's profile Send private message
ermanjitsingh

New User


Joined: 08 Jun 2009
Posts: 19
Location: Banglore

PostPosted: Wed Jul 15, 2009 4:51 pm    Post subject: Re: Reply to: ISPF - TBDELETE help to delete a row from a ta
Reply with quote

AbuHaya wrote:


when deleting, "rowloc" will return the row the user choose

Like this:
Code:
Address ISPEXEC "TBDELETE <TableName> ROWID(rowloc)"


"TBDELETE vcdtbl ROWID(rowloc)"

I tried this line of code. And its giving the error :


Code:

ISPS103                                                         
                                                                 
Too many parameters                                             
Unexpected parameters were found on the dialog service statement.
                                                                                                                                                                                                                 
Current dialog statement:                                       
TBDELETE vcdtbl ROWID(rowloc)       
 

I don't think that we can use ROWID option with TBDELETE.

Any one have any idea that can we use ROWID with TBDELETE or not ?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 4:57 pm    Post subject:
Reply with quote

What does it say in the manual ?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts ISPF - How to come out of ISPF Panel parasmalik20 TSO/ISPF 5 Tue Feb 21, 2017 7:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us