View previous topic :: View next topic
|
Author |
Message |
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
Hi,
We are updating the OS/390 to Enterprise Cobol. Enterprise Cobol does not support the "SEARCH ALL" command. Hence, we need to modify the programs wherever this command is used. Which command can be used to replace the "SEARCH ALL" command.
Thanks in advance for the help.
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
since when does Enterprise COBOL not support the 'SEARCH ALL' command? |
|
Back to top |
|
|
rahuindo
New User
Joined: 09 Apr 2008 Posts: 83 Location: Chennai
|
|
|
|
I meant that Warning messages are issued during the compilation of the programs containing "SEARCH ALL" function. Hence we face problems during the compilation of the programs. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what are the warning messages? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Which command can be used to replace the "SEARCH ALL" command. |
Try "SEARCH ALL". Section 6.2.32 of the Enterprise COBOL Language Reference manual, format 2, includes SEARCH ALL as a valid and usable construct. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
I got some infomation which may be useful to you.
Quote: |
LE APAR PQ95124 corrected errors in the COBOL SEARCH
ALL statement.
However, users have found COBOL applications that
depend on the erroneous behavior!
SEARCH ALL with prior COBOL releases::
1. If search argument longer than table key, in some cases argument
matched key even when excess digits/characters were not
zeros/blanks:
01 Arg1 pic X(8). "ABCDxxxx".
...
03 Key1 pic X(4). "ABCD"
2. Signed search argument with negative value may match
unsigned table key:
01 Arg2 pic S9(4). -1234
…
03 Key2 pic 9(4). 1234
Note: these should compare unequal! Just as in:
IF Key(IX) = Arg …
SEARCH … WHEN Key(IX) = Arg … (serial search, no ALL…)
V3R4 compiled SEARCH ALL WHEN will compare unequal as well.
V4 compiler (and V3R4 with PTFs for APAR PK16765)
generates warning messages for SEARCH ALL statements
that might have different results. Whether an actual change
occurs depends on the contents of the search argument at
run time
LE/COBOL runtime (with PTFs for APAR PK15432)
generates warning messages if search argument value can
never match a table key
Go to Use [URL] BBCode for External Links
Search for item 1243387 |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I imagine rahuindo's problem has to do with 'almost non-standard' data definitions used by the SEARCH ALL command, which earlier releases of COBOL accepted. As you migrate to a newer version of any application, backwards capatibility is usually protected: but poor code - bad syntax - is not accepted.
The OP has probably read the warnings and understands that he has crap modules that he must modify.
The problem is not with the new compiler, it is with the old garbage-sources. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Dick, on the other hand the O/P did say
Quote: |
Which command can be used to replace the "SEARCH ALL" command. |
so it sounds like the first choice is not to correct the bad syntax but to get rid of the code.
rahuindo: you're better off understanding why you're getting the messages and fixing them instead of dumping a section of code that might have been written to use SEARCH ALL for some very good reasons. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And someone (DBZ) asked what the messages are. If you post the messages (including the messsage id's) we may be be to offer suggestions.
Unless you want to write your own binary search (a very bad choice for this situation), there is no "other command".
Either fix the code that generates the warning(s) or simply live with it. |
|
Back to top |
|
|
|