IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

define ISPF table


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Sun Sep 27, 2009 2:50 pm
Reply with quote

hello,

I am learning how to develop ISPF dialog and want to create my first ISPF table,the following are the steps I made,I am not sure if I am right or wrong,could any one have a look for me and if I am wrong please give me some advices(Bold is the REXX code):
1) /* REXX */
"ISPEXEC LIBDEF ISPTLIB DATASET ID('GDC108.TABLELIB')"

To set my own library for ISPF table,but I can not find the table in this library after running my REXX program.
2) "ISPEXEC TBCREATE TABLE1 KEYS(EMPSER) NAMES(LNAME FNAME I PHA PHNUM) WRITE"
Following the example in the reference to create the table.
3)
EMPSER = 598304
LNAME = ROBERTSON
FNAME = RICHARD
I = P
PHA = 301
PHNUM = 840-1224
"ISPEXEC TBADD TABLE1"
EMPSER = 172397
LNAME = SMITH
FNAME = SUSAN
I = A
PHA = 301
PHNUM = 547-8465
"ISPEXEC TBADD TABLE1"

Add data of rows to table
4) "ISPEXEC TBCLOSE TABLE1"
Following the example in the reference,because it is said that the table does not become permanent until it is stored on direct storage by either the TBSAVE or TBCLOSE service.
5) "ISPEXEC LIBDEF ISPTLIB"

at last I can not find the desired table TABLE1 in my private lib called 'GDC108.TABLELIB',could someone give me some advices or show me some codes that can create a ISPF table?


Thanks a lot
Henry icon_biggrin.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sun Sep 27, 2009 8:15 pm
Reply with quote

looks pretty good. But show us the trace.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Sun Sep 27, 2009 10:02 pm
Reply with quote

thanks for reply,Pedro,
my key point is that I can not find TABLE1 in my own lib 'GDC108.TABLELIB'.
actually I did not have such experience of dealing table,but I rearched some posted topic in this forum and I noticed this passage:
Quote:

"ISPTLIB is the Table Input Library and is required.
ISPTABL is the Table Output Library and is optional. You must allocate it only if an application uses table services.

The table output library must be a partitioned data set. The ISPTABL ddname that defines the table output library can specify the same data set as the table input library, ddname ISPTLIB. The first data set in the ISPTLIB concatenation should be the same as the data set used for ISPTABL. This ensures predictable behavior of dialogs that use table services without specifying the LIBRARY keyword. The output and input data sets must be the same if the updated version of a table is to be reprocessed by the same dialog that updated it.

You must allocate the table output library to ddname ISPTABL before using table services. "


so my problem has the relation with ISPTABL and ISPTLIB?or something else is wrong?you can see my rexx code in bold format...
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Sep 28, 2009 3:13 am
Reply with quote

Now read your own post... (wait 5 minutes while you read). Is your table in your ISPTABL dataset?

You may wish to change from TBCLOSE to TBSAVE which has a library parameter.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Mon Sep 28, 2009 8:00 am
Reply with quote

hi Pedro,thanks for your reminder,now it is working,the code is like this:
Code:
/* REXX */                                                           
/* set the table output dataset ISPTABL */                           
 "ISPEXEC LIBDEF ISPTABL DATASET ID('GDC108.ISPTABL')"               
/* create a table */                                                 
 "ISPEXEC TBCREATE TABLE1 KEYS(EMPSER) NAMES(LNAME FNAME I PHA PHNUM)
  WRITE "                                                           
/* add two rows to the table */                                     
 EMPSER = 598304                                                     
 LNAME = ROBERTSON                                                   
 FNAME = RICHARD                                                     
 I = P                                                               
 PHA = 301                                                           
 PHNUM = 840-1224                                                   
 "ISPEXEC TBADD TABLE1"                                             
 EMPSER = 172397                           
 LNAME = SMITH                             
 FNAME = SUSAN                             
 I = A                                     
 PHA = 301                                 
 PHNUM = 547-8465                         
 "ISPEXEC TBADD TABLE1"                   
/* save the data to the output dataset */ 
 "ISPEXEC TBSAVE TABLE1"                   
/* close the table */                     
 "ISPEXEC TBCLOSE TABLE1"                 
/* set ISPTABL to default */               
 "ISPEXEC LIBDEF ISPTABL" 

the key point is that ISPTABL is for table ouput and ISPTLIB is for table input,so if you want to invoke the table and show the rows in panel,you should set like this:
Code:
"ISPEXEC LIBDEF ISPTLIB DATASET ID('GDC108.ISPTABL')"
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Sep 28, 2009 9:17 pm
Reply with quote

I do not think your code is working as it should.

Always creating the table then saving it is not a real world situation. I think you should try TBOPEN to see if exists and use the existing table. Only if it does not exist should you create a new one.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Mon Sep 28, 2009 11:06 pm
Reply with quote

Hi Pedro,you are right...thanks icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top