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
 

 

Compare two ISPF tables

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

New User


Joined: 15 Nov 2013
Posts: 10
Location: India

PostPosted: Thu Dec 05, 2013 12:24 pm    Post subject: Compare two ISPF tables
Reply with quote

Hi All,

I want to compare the records in two different ISPF tables. Is there any table service for this purpose. Or should I unload the table to a dataset and then compare the records.

The table A and table B has same column names, I want to compare the values of column1 in table A with values of column2 in table B and figure out whether they match or not.

Both are keyed tables.

Thanks
Back to top
View user's profile Send private message

TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Thu Dec 05, 2013 1:08 pm    Post subject:
Reply with quote

I guess there are no table services to directly compare two ISPF tables. You can probably write a logic using REXX (using TBSCAN forward search from top) to read and compare the tables.
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: Thu Dec 05, 2013 2:31 pm    Post subject:
Reply with quote

Tables should be members in a PDS, so what's the problem ?
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Thu Dec 05, 2013 8:34 pm    Post subject:
Reply with quote

ISPF tables can only be stored in PDS members. But their structure does not fit into the record structure of this file system. The number of fields might not be fixed with all table records. In addition the length of the fields is never fixed.
This causes ISPF to store table data in a "stream-like" format with some header data followed by the record data with each column separated by special characters (x'00') and a hex length field introducing and identifying the following data as column contents. The data of each table row is written up to the length of the current record and then continued in the next record.
So it is impossible to use a simple file compare utility which assumes that every record has the same layout.
I recommend exporting the table data to two datasets with the ISPF Table Utility (usually option 3.16) and then run a compare on the resulting datasets.
If you need to do it programmatically I'm pretty sure that you have to follow TheMFKid's advice.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Dec 06, 2013 1:00 am    Post subject: Reply to: Compare two ISPF tables
Reply with quote

Quote:
compare the values of column1 in table A with values of column2 in table B

Stefan and theMFkid are right, but even then the col1 and col2 requirement makes the task a little harder. Even if there was a tool to compare table to table, you might still need to write your own to compare col to col.

Quote:
Tables should be members in a PDS, so what's the problem

As Stefan pointed out, the table structure does not map well in to FB80 records. A change in the first row will cause a change in all subsequent records, making a normal member comparison meaningless.
Back to top
View user's profile Send private message
rameyshkanthan v

New User


Joined: 15 Nov 2013
Posts: 10
Location: India

PostPosted: Fri Dec 06, 2013 1:48 pm    Post subject:
Reply with quote

Thank you all, I have coded the logic in REXX (TBSCAN)
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm
No new posts I am unable to use SWAPBAR ON command... mrsidhu12 TSO/ISPF 3 Thu Sep 01, 2016 1:10 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am


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