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

Duplicate handling while loading entries in to an ISPF table


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

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Aug 04, 2009 10:26 am
Reply with quote

Hi,

I'm new to ISPF tables.

I have a requirement to load the entries read from a file in to an existing ISPF table.
If a duplicate entry found, i need to update certain fields in the table and not to abend the loading process.

Could anyone please tell me how to handle this scenario using REXX?

Please let me know if you need anyother information.

Regards,
ursvmg
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 04, 2009 11:23 am
Reply with quote

If the table is keyed, then when you read the next record to load, do a TBSCAN to see if the key value already exists in the table.

Of course, you could always SORT the input file first.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Aug 04, 2009 11:59 am
Reply with quote

Hi,
TBSCAN is returning a RC of 8.
I tried to read the table with a TBSCAN statement like below.
Code:
/* REXX */
ADDRESS ISPEXEC
"LIBDEF ISPTABL DATASET ID('XXXX.ISPTLIB')"
"LIBDEF ISPTLIB DATASET ID('XXXX.ISPTLIB')"
"TBOPEN EMP1 WRITE SHARE"
EMP_ID = 1
"TBSCAN EMP1 ARGLIST(EMP_ID)"
SAY RC
"TBCLOSE EMP1"
EXIT


There is an entry present in the table with key '1'

I need to update another field called NAME if the key is already present.

Please help.

Regards,
Ursvmg
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 04, 2009 1:34 pm
Reply with quote

After a little play time I would say that the key you are testing for does not match the key format that you are using in the search.

Does the table key have leading zeros. You will need to look at how the key has been loaded into the table and then use the same format to search for duplicates.

I loaded my table with keys 001, 002, 003, 004 and 005, but when searching for key 1 it gave RC8, but using 001 it gave RC0.
Back to top
View user's profile Send private message
anjali_tcs

New User


Joined: 09 Jun 2008
Posts: 10
Location: GGN

PostPosted: Tue Aug 04, 2009 2:06 pm
Reply with quote

As per the ISPF manual :

Quote:
Comparisons between the row values and the argument list are always done on a
character basis. That is, the values are considered character data, even if they
represent numbers.


Also, out of curiosity can you check on RC for your TBOPEN icon_question.gif [/quote]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 04, 2009 2:13 pm
Reply with quote

anjali_tcs wrote:
As per the ISPF manual :Also, out of curiosity can you check on RC for your TBOPEN icon_question.gif


As per the ISPF manual
Quote:

12
Table is not open.

If the TBOPEN had failed the return code would have been 12, and not 8 as specified by the OP.

Please think about your replies before posting. The idea of a help forum is to help people, not to mislead them icon_cry.gif
Back to top
View user's profile Send private message
anjali_tcs

New User


Joined: 09 Jun 2008
Posts: 10
Location: GGN

PostPosted: Tue Aug 04, 2009 2:21 pm
Reply with quote

Apologies for confusion....i was mistaken...
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 Duplicate transid's declared using CEDA CICS 3
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 Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top