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
 

 

define ISPF table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: define ISPF table
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

Senior Member


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

PostPosted: Sun Sep 27, 2009 8:15 pm    Post subject: Reply to: define ISPF table
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    Post subject:
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

Senior Member


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

PostPosted: Mon Sep 28, 2009 3:13 am    Post subject: Reply to: define ISPF table
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    Post subject:
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

Senior Member


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

PostPosted: Mon Sep 28, 2009 9:17 pm    Post subject: Reply to: define ISPF table
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    Post subject:
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    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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 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


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