There's a couple of differences. The first is that TBSARG uses *all* of the variables defined in the table as a search criteria, unless the value of the variable at the time of the TBSARG is null. The ARGIST parm isn't which variables to use, it is which /extension/ variables to use. NAMECOND only establishes conditions for variables previously determined to be in the criteria, it doesn't determine which variables to use.
A consequence of that is you can't scan for a null value (except if the variable is VDEFINEd with NOBSCAN). But the more important difference is when you're trying to scan for more than one matching row, i.e. you're scanning in a loop. Let's say you wanted to scan for LIST NE IBM-MAIN. You set the LIST variable to IBM-MAIN and do the first TBSCAN. This finds the row with LIST equal to ASSEMBLER-LIST. That's a valid hit. Now you do another TBSCAN. But LIST is /currently/ equal to ASSEMBLER-LIST, so your scan criteria becomes LIST NE ASSEMBLER-LIST. That finds IBM-MAIN, which is not what you wanted. The same problem can happen with EQ searches, if part of the logic executed to process the row modifies any of the table variables. TBSARG doesn't have this problem because it "freezes" the scan criteria at the time you issue the command. -----Original Message----- From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Lionel B. Dyck Sent: Friday, July 12, 2024 6:24 AM To: [email protected] Subject: to tbsarg/tbscan or just tbscan - that is the question Cross posting to ISPF-L and IBM-Main So, I can do "tbsarg table namecond(var,eq)" "tbscan table" Or I can do "tbscan table arglist(var)" Both provide the same results, at least in my limited testing. What advantages are there in using the tbsarg/tbscan compared to just using tbscan? Lionel B. Dyck <>< Github: https://github.com/lbdyck System Z Enthusiasts Discord: https://discord.gg/sze "Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are." - - - John Wooden ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
