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

FIND keyword usage in the ISPF


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

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 09, 2010 1:58 pm
Reply with quote

Hi,

I have the below find command in ISPF

Code:


      "FIND 'IDENTIFICATION DIVISION'" "'"word"'"

         where 'word' has the string to be searched in it.

 


what would be the output for this (boolean or ???) if i put the command as
Code:

     M= "FIND 'IDENTIFICATION DIVISION'" "'"word"'"

and as the syntax holds for identification division does it search only the identification division till the environment division ???
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Jun 09, 2010 2:45 pm
Reply with quote

Which planet do you live on? The command is not an ISPF command, did you actually try it?????
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jun 09, 2010 5:44 pm
Reply with quote

Is this the continuation of "command to know the prefix" ?

And you still don't understand how FIND work ?
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 09, 2010 6:40 pm
Reply with quote

no, i dint still find the way out ...
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Wed Jun 09, 2010 6:44 pm
Reply with quote

Please let me know the output for the above find command and want to know whether it will search only in the identifiaction division or below that.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Jun 09, 2010 6:56 pm
Reply with quote

tecnokrat,

Are you fustrated that you can not get answers to your questions?

Many of the 'experts' have hundreds or thousands of posts and have helped many people.

The only logical conclusion is that the question is so poorly stated that they are unable to help.

In this case you throw a single 'command' out there completely out of context, and expect a specific answer.

Try explaining:
1) exactly what you are doing when you issue this command (I am editing a pds member for example)
2) in what type of program this command is located (edit macro for example)
3) what results come of the execution

If you want help, you have got to do a better job of asking for it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 09, 2010 6:57 pm
Reply with quote

tecnokrat,

here is the FIND command syntax: FIND--find a search string

unless you use labels or line numbers, the FIND command will search the complete workarea or just stop after the first hit.

identification division is not an accepted delimiter for the FIND command.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 09, 2010 7:06 pm
Reply with quote

Quote:
no, i dint still find the way out ...


You will want to study the Edit and Edit Macros manual. www-03.ibm.com/systems/z/os/zos/bkserv/r11pdf/#ispf

It is easier for you if you read the manual and learn the actual syntax of the FIND command. It is much harder for you if make up your own syntax and then ask if it works.

If you want to limit your search, you need to first find the beginning, mark it with a LABEL, such as '.abc', then find the end and mark it with a different label, such as '.def'.

Then "FIND 'word' .abc .def" will only search within the lines marked by your labels.

To issue several command, you will want to write an editor macro.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 09, 2010 7:29 pm
Reply with quote

The editor used on the mainframe has been around a long time -- much longer than the PC IDE's (integrated development environments) in use. As such, many of the more recent innovations are not directly available to the editor -- such as searching only one section of code. That requires an IDE with some intelligence about what IDENTIFICATION DIVISION means -- and that capability just is not presently available in the mainframe ISPF editor (or TSO editor for that matter). You can simulate this, as Pedro stated, by using line labels to delimit your search but that's about the limit.

If you think of the mainframe editor more as Notepad than an IDE I think you'll be less frustrated with the commands available.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 09, 2010 8:38 pm
Reply with quote

Hello,

You were told/asked before (in the other topic with the same question. . .) and now again:
Quote:
You know what you are talking about - we have confusion

Suggest you post a few sets of sample data and the "answer" you want when these samples are processed by your code. . .
If you want help you have to post exactly what you're trying to do.

Do not make up any more syntax of your own. Do not run around in circles. Post the sample data and what should happen when your process runs successfully.

If you cannot be bothered to do this, we can lock/delete both of these topics. The reason this has dragged on thru multiple forum topics is your unwillingness to post something useful. . . icon_sad.gif

d
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 09, 2010 8:45 pm
Reply with quote

Quote:
integrated development environments


Perhaps use "Rational Developer for Z"
Back to top
View user's profile Send private message
tecnokrat
Warnings : 1

Active User


Joined: 22 May 2009
Posts: 160
Location: Bangalore

PostPosted: Thu Jun 10, 2010 9:13 am
Reply with quote

Firstly the requirement is i need to search a string in the whole file if the particular file is found at any place then i should go ahead with the other logic else i need to drop-off.


The Major concern i face here is the output of FIND command, im unable to know what would it return when this command is given.
Code:
    "FIND 'word' .abc .def" instead i gave the following
"FIND 'WORD' IDENTIFICATION DIVISION. ENVIRONMENT DIVISION"


Does the above code works????

hi Pedro,
as said by you to use the command to issue the labels ,
Code:

  "FIND 'word' .abc .def"


And does the labels be set dynamically in each member of a PDS ,kindly let me know
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 10, 2010 9:16 am
Reply with quote

Quote:
The Major concern i face here is the output of FIND command, im unable to know what would it return when this command is given.


well... should not be that difficult to find out;
try and tell us

and instead of word use a different term, string might be better
word is one of the optional parameters of the find command
( as You might find out reading the manual, or hitting the PF1 key )

given the lines

Code:
aaabbbccc
aaa bbb ccc


FIND 'aaa' will return as a hit both lines
FIND 'aaa' word will return as a hit only the second one
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 10, 2010 9:24 am
Reply with quote

Sometimes I just want to cry.....
At least the OP does not list TSO/ISPF as a mainframe skill and his occupation, employee, is rather original.
Maybe the OP will actually look at the ISPF links provided and understand the error of his ways.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 10, 2010 9:46 am
Reply with quote

Hello,

Rather than continuing to focus on the one command (FIND - which is completely misunderstood) maybe you can explain what the process is supposed to do. The way you are working with the FIND, progress is still far away.

If your process was completely working and i used it what would it do for me? Not just this FIND, but the entire process? If we understand the requirement, someone may have a suggestion.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 10, 2010 10:11 am
Reply with quote

The TS does not deserve the time we are spending on Him, I wonder if He has looked at the manual or pressed the PF1

Quote:
If we understand the requirement, someone may have a suggestion.


we are discussing how to use a hammer, but we do not know if we have to drive nails or screws

let' s try to convince the OP to tell the requirement
and if He cannot explain it clearly let' s get rid of both topics, they just waste space on the server
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Jun 10, 2010 1:26 pm
Reply with quote

tecnokrat wrote:
Firstly the requirement is i need to search a string in the whole file if the particular file is found at any place then i should go ahead with the other logic else i need to drop-off.


The Major concern i face here is the output of FIND command, im unable to know what would it return when this command is given.
Code:
    "FIND 'word' .abc .def" instead i gave the following
"FIND 'WORD' IDENTIFICATION DIVISION. ENVIRONMENT DIVISION"


Does the above code works????

hi Pedro,
as said by you to use the command to issue the labels ,
Code:

  "FIND 'word' .abc .def"


And does the labels be set dynamically in each member of a PDS ,kindly let me know

  • First you say you want to look for a string in the whole file, then you try to build a command that would supposedly search for a string only in the ID DIVISION.
    You must understand that such request is a bit confusing...

  • Why are you "unable to know what would it return when this command is given" ?
    You only need to edit a file, type the command and look at the response.
    What is stopping you ?

  • You have been asked a few times to explain exactly what you want to do.
    Here are two good reasons why:
    1. some programs start with "IDENTIFICATION DIVISION", some with "ID DIVISION"
    2. some programs do not have a "ENVIRONMENT DIVISION", which is not mandatory.
    You have to tell us what you are looking for, so we can help you anyway.

  • Except for your FIND command, you haven't shown any code.
    Can we look at the first 4 lines of your macro ?
    I suspect there is much to say about them too. icon_rolleyes.gif
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Jun 10, 2010 6:43 pm
Reply with quote

Luckily it is psychic day here in Pennsylvania.

Based on the vague information provided, I am guessing that you are looking for some sort of comment in the identification division. The comment may be a version number or a change release number.

You are trying to write an edit macro, and are trying to create your own syntax for the find command.

So I have written an edit macro as an example. In my example I set the value of string = 'version'.

Code:

/* REXX EXEC TO CHECK FOR A STRING */

"ISREDIT MACRO"

STRING = 'VERSION'

"ISREDIT FIND 'IDENTIFICATION DIVISION.' FIRST"
RCODE = RC
IF RCODE = 0 THEN DO
 "ISREDIT (LINE1,COL1) = CURSOR"
 "ISREDIT LABEL " LINE1 " = .S 0"
END
ELSE DO
  SAY 'IDENTIFICATION DIVISION. NOT FOUND EXITING MACRO'
  EXIT
END

"ISREDIT FIND 'ENVIRONMENT DIVISION' FIRST"
RCODE = RC
IF RCODE = 0 THEN DO
 "ISREDIT (LINE1,COL1) = CURSOR"
 "ISREDIT LABEL " LINE1 " = .E 0"
END
ELSE DO
  SAY 'ENVIRONMENT DIVISION NOT FOUND EXITING MACRO'
  EXIT
END

"ISREDIT FIND '"STRING"' .S .E FIRST"
RCODE = RC
IF RCODE = 0 THEN SAY 'STRING *'STRING'* FOUND'
ELSE SAY 'STRING *'STRING'* NOT FOUND'

EXIT


To execute this macro, I am in edit or view and type TECH1 on the command line and press enter.

The macro name TECH1 exists as a member in a clist/rexx/macro library allocated to my tso session.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Jun 10, 2010 7:44 pm
Reply with quote

Quote:
The Major concern i face here is the output of FIND command, im unable to know what would it return when this command is given.

Please read the manual, especially the FIND and LABEL sections. Please let me know when you have read the manual. The labels have a specific syntax.

Quote:

Code:
"FIND 'word' .abc .def" instead i gave the following
"FIND 'WORD' IDENTIFICATION DIVISION. ENVIRONMENT DIVISION"


Does the above code works????

It will not work as you have shown it.

Quote:
hi Pedro,
as said by you to use the command to issue the labels ,
Code:

"FIND 'word' .abc .def"


And does the labels be set dynamically in each member of a PDS ,kindly let me know

No, you have to write a macro that will issue several things, including setting the labels. You have to invoke the macro for each time you need that function.
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 Looking for a little history of ISPF ... TSO/ISPF 5
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
Search our Forums:

Back to Top