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

find a string in a ps file using macro w/o opening file


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 8:43 pm
Reply with quote

Hi

I am using the below mentioned code..
/*REXX*/
INDSN='F0091PSH.GV2L.PARG.AMEND.EXTRACT.RECS.N10331'
ADDRESS ISPEXEC "VIEW DATASET('"INDSN"') MACRO(TESTI)"

actually i don't want to view the file..i simply want to count w/o opening the file.

my macro testi is:

/*REXX*/
ADDRESS ISREDIT
"MACRO"
"SEEK ALL '0107130E'"
"(V1)=SEEK_COUNTS"
SAY V1


It gives result but it opens the file in view mode also..which i dont want
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 21, 2011 8:48 pm
Reply with quote

You just need to finish your macro so that it ends the VIEW service when it's done.
Back to top
View user's profile Send private message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 8:57 pm
Reply with quote

just gave exit at the end..still it opens..could u suggest something else?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 21, 2011 8:59 pm
Reply with quote

An END statement would be helpful.
Back to top
View user's profile Send private message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 9:01 pm
Reply with quote

gave an END after macro ends..getting error
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 21, 2011 9:20 pm
Reply with quote

How about posting the error. Like we can actually see your screen from where we are icon_rolleyes.gif

Psychic day is Wednesday this week.
Back to top
View user's profile Send private message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 9:23 pm
Reply with quote

Hi

I gave a do and end
/*REXX*/
ADDRESS ISREDIT
DO
"MACRO"
"SEEK ALL '0107130E'"
"(V1)=SEEK_COUNTS"
CHAROUT(INDSN);
SAY V1
END

I am not getting error but still it opens the file in view mode..which i dont want
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Mar 21, 2011 9:29 pm
Reply with quote

It seems that you also added a 'DO' before the "MACRO" statement - thus the 'END' signals the end of the DO loop, not the end of the view session.
Back to top
View user's profile Send private message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 9:36 pm
Reply with quote

gave
/*REXX*/
ADDRESS TSO
INPUT='F0091PSH.GV2L.PARG.AMEND.EXTRACT.RECS.N10331'
"ALLOC F(MYDDNAME) DA('"INPUT"') SHR REUSE"
"EXECIO * DISKR MYDDNAME (STEM REC. FINIS)"
"FREE F(MYDDNAME)"
DO
ADDRESS ISPEXEC "VIEW DATASET('"INPUT"') MACRO(TESTI)"
END

still file opens in view mode
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Mon Mar 21, 2011 10:02 pm
Reply with quote

Can you please think about what you are doing in your last try, because it has nothing to do with your initial requirement...
Back to top
View user's profile Send private message
abhikulsh
Currently Banned

New User


Joined: 17 Feb 2011
Posts: 12
Location: chennai

PostPosted: Mon Mar 21, 2011 10:06 pm
Reply with quote

actually moderator suggested to use END so i gave this way..but no use..the file is still opening in view mode
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Mon Mar 21, 2011 10:16 pm
Reply with quote

And if the moderator were to suggest that you stick your head in a bucket with ice-cold water, you would also do it?

Just my suggestion, but maybe reading a manual would help?
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Mar 21, 2011 10:16 pm
Reply with quote

Actually, moderator did NOT say to use DO, so why did you do it that way?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Mar 21, 2011 10:17 pm
Reply with quote

( very good mood on )
the TS was too lazy to click on the END link and simply stuck an END statement somewhere...
but the he got the message for a <dangling> Rexx END
so he stuck a pairing DO ...
( nothing syntactically wrong from a Rexx point of view... but useless )

so repeat with me ( or rather by Yourself ) a few zillions times
to <end/terminate> an EDIT macro an "Address ISREDIT END" statement is needed

outer macro
Code:
000001 /* REXX */
000002 Address ISPEXEC
000003    "VIEW DATASET('USER.CLIST(sampl)') MACRO(INNER) "
000004 exit


inner macro

Code:
000001 /* REXX */
000002 Address ISREDIT
000003 "MACRO"
000004 "SEEK ALL 'DISPLAY' "
000005 "(COUN) = SEEK_COUNTS"
000006 say "COUN=" coun
000007 "END"
000008 exit


disregard the dataset name and the <SEEKED> string !
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 22, 2011 1:45 am
Reply with quote

Quote:
the TS was too lazy to click on the END link and simply stuck an END statement somewhere...

Like.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 22, 2011 2:13 am
Reply with quote

Sigh. And I'm the one who's unemployed?
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top