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
 

 

Duplicate handling while loading entries in to an ISPF table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Duplicate handling while loading entries in to an ISPF table
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 04, 2009 11:23 am    Post subject:
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    Post subject: Reply to: Duplicate handling while loading entries in to an
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 04, 2009 1:34 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 04, 2009 2:13 pm    Post subject:
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    Post subject:
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    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 a Modified Mapset Susanta CICS 2 Tue Mar 14, 2017 5:43 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
No new posts ISPF - How to come out of ISPF Panel parasmalik20 TSO/ISPF 5 Tue Feb 21, 2017 7:44 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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