MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSO and ISPF..... what does FIND_COUNTS does?
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Mon Apr 30, 2012 12:00 pm    Post subject: TSO and ISPF..... what does FIND_COUNTS does? Reply with quote

Iam trying to catch the value stored in FIND_COUNTS and have to use that value in another rexx program.

I used the following code to get the reuirement.

"ISREDIT (FCOUNT) = Find_Counts"
PUSH FCOUNT


But the Problem is when i put display iam getting as "DISPLAY" in FCOUNT.

SAY 'Find counts' FCOUNT.

can any one help me out!!!!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Apr 30, 2012 12:58 pm    Post subject: Reply with quote

Naresh,

If you need the variables in another rexx exec you need to use VPUT and VGET . Alternatively the variable you want to return is numeric, so you could use "exit" with the variable as the return code.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Apr 30, 2012 3:33 pm    Post subject: Reply with quote

as long as another FIND command is not invoked,
the FIND_COUNTS variable always contains the count of the last find command,
within the edit session.
yeah, to other rexx needs to address ispedit.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Mon Apr 30, 2012 9:50 pm    Post subject: Reply with quote

Kolusu - I tried Making Use of PULL and PUSH Command,but still not ale to reach to my reuirement.

Brenholtz - iam not getting what it mean the another FIND command? i used the Below piece of code...

=======================================================

inp = 'DISPLAY'

push inp

address ispexec
"view dataset('"srcds"') macro(MacroEX)"

pull FCOUNT

if FCOUNT = 0 then say inp' exists in 'srcds


MACROEX
--------

/* REXX */
address isredit
"macro"
"FCOUNT"
"x all '*' 7"
pull inp
"f all nx " inp
"ISREDIT (FCOUNT) = Find_Counts"
SAY "find counts " Fcount
push FCOUNT
"end"

Please correct me if anything i did wrong. in the below display statement iam not seeing any value.

SAY "Find counts" FCOUNT


And one more doubt - will the SAY statements execute in the MACRO?
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Tue May 01, 2012 1:27 am    Post subject: Reply with quote

Perhaps if you read up on the commands that Kolusu has suggested rather than completely different commands yo may start to make some progress
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Wed May 02, 2012 11:01 am    Post subject: Reply with quote

Hi All - I tried executing the code with the help of VGET and VPULL Commands. Still Iam not able to reach My destination Sad . But i absored two points.

1) Iam not able to transfer the value to main REXX program from second rexx program(here it is Macroex)

2) even the Find_Counts value iam not ale to capture. i could see in diaplay statement the value as space.

please find the below code and correct me. Thanks to all in advance.
Code:

/* REXX1 PROGRAM */                                           
INP = 'DISPLAY'                                               
"ISPEXEC VPUT (INP) SHARED"                                   
"ISPEXEC VIEW DATASET('"NARESH.FILE.EXAMPLE"') MACRO(MACROEX)"
"ISPEXEC VGET (FIND) SHARED"                                   
 SAY 'RC '                                                     
 SAY 'FIND COUNTS' FIND                                       
IF FIND = 0 THEN                                               
DO                                                             
SAY INP' EXISTS IN 'SRCPDS                                     
END                                                                 


MacroEX :
Code:

/*REXX*/                           
ADDRESS ISREDIT                     
"MACRO"                             
"FIND"                             
"RES"                               
"ISREDIT EXCLUDE ALL '*' 7"         
"ISPEXEC VGET (INP) SHARED"         
SAY 'COMING ' INP                   
"ISREDIT F ALL NX 'DISPLAY' "       
"ISREDIT (FIND) = FIND_COUNTS"     
     SAY 'FCOUN 'FIND               
"ISPEXEC VPUT (FIND) SHARED"       
EXIT                               


As a Beginner looking for helping hands Smile
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed May 02, 2012 12:29 pm    Post subject: Reply with quote

Well, no expert on macros but if your find count is 0 then your string was NOT found but your REXX1 is trying to say the opposite.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Wed May 02, 2012 9:25 pm    Post subject: Reply with quote

yes Clouston - I have to use "not equal" in REXX1. Typo mistake Smile

But the problem here is I can't able to capture the "Find_counts" and i can't able to use this value in REXX1 program. have any idea on this.

Thanks for your response!!!
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu May 03, 2012 3:54 am    Post subject: Reply with quote

Have you used a trace in REXX to see what is happening ?
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu May 03, 2012 6:58 am    Post subject: Reply with quote

expat wrote:
Have you used a trace in REXX to see what is happening ?


obviously not.

1. even the manual suggests using a variable name FINDS as apposed to FIND.

2. the third or fouth line of your macro there is a FIND command without params "FIND", which will generate a non-zero RC.

3. and for the second time, i state, that you do not have to pass the find-count from the macro to the main rexx. you can issue the FIND_COUNTS in your main script after return from the macro invoked by the VIEW DATASET command.

4. since you refuse to check RC's after every service CALL,
a typical rookie trick,
you need to start using TRACE to debug you scripts.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu May 03, 2012 12:06 pm    Post subject: Reply with quote

Line 4 of macroex: FCOUNT is not an editor command. The macro may be failing before executing your FIND or if FCOUNT is a macro, that macro (FCOUNT) may be corrupting the stack.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Fri May 04, 2012 3:00 am    Post subject: Reply with quote

Hi All,

I Have used the TRACE Command to known where iam going wrong. I could see RC(20) for all th estatements which i have declared in Macroex module. Don't know why iam getting this errors. Please find the Code long with the trace displays

My REXX1 program :

/* REXX1 */
TRACE ?E
INP = 'DISPLAY'
ADDRESS ISPEXEC "VPUT (INP)"
"ISPEXEC VIEW DATASET('"BOST.NBKV6D2.EXAMPLE"') MACRO(MACROEX)"
IF 'FIND_COUNTS' > 0 THEN DO
SAY INP' EXISTS IN 'SRCPDS
END
ELSE DO
SAY INP' DOES NOT EXIST 'SRCPDS
END
EXIT

TRACE OUTPUT :

DISPLAY DOES NOT EXIST SRCPDS /* it seems no errors in this module*/


MACROEX :

Code :
/*REXX*/
TRACE ?E
ADDRESS ISREDIT
ISREDIT "X ALL '*' 7 "
ADDRESS ISPEXEC "VGET (INP) PROFILE"
SAY 'COMING ' INP
"F ALL NX 'DISPLAY'"
" ISREDIT (FIND) = FIND_COUNTS "
SAY 'VALU3' FIND

TRACE OUTPUT OF MACROEX :

4 *-* ISREDIT "X ALL '*' 7 "
+++ RC(20) +++
Interactive trace. TRACE OFF to end debug, ENTER to continue. +++

5 *-* ADDRESS ISPEXEC "VGET (INP) PROFILE"
+++ RC(8) +++

7 *-* "F ALL NX 'DISPLAY'"
+++ RC(20) +++

8 *-* " ISREDIT (FIND) = FIND_COUNTS "
+++ RC(20) +++

Iam just beginner in REXX so please don't hesistate to answer my question Sad
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri May 04, 2012 5:45 am    Post subject: Reply with quote

macroex is not an ispedit macro.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Naresh
Beginner


Joined: 27 Apr 2012
Posts: 8
Topics: 1

PostPosted: Fri May 04, 2012 7:32 am    Post subject: Reply with quote

Hi Brenholtz - sorry for my question - what does it mean that macroex is not an ISPedit macro? and also let me know how can i correct it. below is my Macroex code.

/*REXX*/
TRACE ?E
ADDRESS ISREDIT
"MACRO"
ISREDIT "X ALL '*' 7 "
ADDRESS ISPEXEC "VGET (INP) PROFILE"
SAY 'COMING ' INP
"F ALL NX 'DISPLAY'"
" ISREDIT (FIND) = FIND_COUNTS "
SAY 'VALU3' FIND
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri May 04, 2012 10:07 am    Post subject: Reply with quote

What you have coded here is not what you coded above. Your last post includes the word MACRO but it is not present in your previous post. Stop pfaffing about - use cut and paste and the code tags. Also, you do not appear to have defined SRCPDS. Have you looked at the ISPF EDIT AND EDIT MACRO manual? If not - DO SO. If it is not to hand just cut and paste that title into google and go from there.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group