do you know how you want to define your working-storage?
do you know what COBOL Statements you are going to employ?
the COBOL manuals (Programming Guide and Reference) are found by the IBM MANUALS link at the top of the page.
we only help,
we don't do it for you. _________________ Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
Both search command works only if the string we are searching is of same length.. For e.g. If i have to search CAT and ELEPHANT in a variable, i have to declare a Temporary variable which stores those strings.. 'CAT ' CAT appended with spaces to match string length of elephant..
3) INSPECT command
TALLYING NAME-1 FOR ALL 'CAT'
NAME-2 FOR ALL 'ELEPHANT'
This logic needs those strings to be hardcoded inside the procedure division..
But i do want these strings to be declared in working storage area..
You haven't really posted anythng like the requested pseudo-code.
If the lenght of the data to be searched varies, you will need to have a way to specify the length for the current search. You will also need to identify the length of each of the values you want to look for.
One way to do what you want would be to use reference modification to compare the animal values against the "variable". If you have never done something like this, it will probably take a while to get the hang of it.
Basically, you would write code to "parse" the variable looking for the value(s) that would require setting "the switch". _________________ Have a good one
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum