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

Compare two ISPF tables


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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
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: 8797
Location: Welsh Wales

PostPosted: Thu Dec 05, 2013 2:31 pm
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
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

Global Moderator


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

PostPosted: Fri Dec 06, 2013 1:00 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top