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

Edit Macro for finding an Blank Line in a file


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

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Apr 02, 2009 4:48 pm
Reply with quote

Dear All,

Is there alternative way other than reading a file using REXX and checking whether particular line is blank or not? Will Edit macro 'Find' work?

Please let me know. icon_biggrin.gif

Murali.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 02, 2009 4:55 pm
Reply with quote

if You describe better the process we might be able to give better suggestions

but the way You posed Your question
a technically correct ( but probably useless) answer would be a plain YES
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Apr 02, 2009 5:16 pm
Reply with quote

enrico
To be more clear on the scope,
i have to find the no of blank lines in a program(available as an member of an PDS), right now i am using REXX Program to read the program till the end of the program to get the number of blanks

"EXECIO * DISKR INPUT (FINIS STEM INPUT."
"FREE DD(INPUT)"
.
.
IF SUBSTR(INPUT.M,7,66) = ' ' THEN
BLANKS = BLANKS + 1
ELSE
CODE = CODE + 1

My objective is to remove this piece of code and replace the Edit macros to find the number of blanks in a code. Can you help me whether 'Find' can be used to find the blanks in the code. If so can you give the syntax.

Thanks,
Murali.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Apr 02, 2009 5:32 pm
Reply with quote

use pf1 in edit mode, look at find command.
there is a P'?' command for non-blanks
(i don't remember the char with which you need to replace the ?
an example P'<' = lower case, p'>' = uppper case
but you can find it in the help screens.

after you have excluded all lines with non-blanks in 7 to 72,
do a find all ' ' in 7. that number will be the number of blank lines.

your edit macro could be something like this:

/* rexx */
isredit macro
reset
x all p'?' 7 72
f all P' ' 7 nx
x = find_counts
end

again, you need to find the special char to replace the ?
but you can find it in the help screens.

my example rexx script may not be syntax pure,
but you can refer to the edit and edit macros manual for exact syntax
for the find_counts
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Apr 02, 2009 6:41 pm
Reply with quote

Thanks Dick
For rrecollecting the stuff 'x all p'?' 7 72'. I believe it must be p'='. Again Thanks for you explanation.

Murali.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Apr 02, 2009 9:29 pm
Reply with quote

Non-blanks are P'¬'. Any character is P'='.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Apr 05, 2009 9:55 pm
Reply with quote

Hi Murali,

You can do something like this (untested) from the cmd line:

x all;f all p'^';f all ' ' x 7

The # of hits will appear in the upper right of the screen.

PS My P' ' char is the same as Terry's. Mine displays as "^".
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sun Apr 05, 2009 10:45 pm
Reply with quote

Jack,
Try hitting 170 (on the numeric key pad on the right) while holding down the Alt key, then let up on Alt to get the ¬.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 06, 2009 12:00 am
Reply with quote

thx for the tip Terry, forget that technical stuff now and then.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Apr 06, 2009 4:19 am
Reply with quote

You're welcome. For the rest of the Extended Ascii Chart, see www.cdrummond.qc.ca/cegep/informat/Professeurs/Alain/files/ascii.htm
Comes in handy for letters like â ë ì ô û ¿ ¢ , etc. The one I most commonly use is résumé. icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Apr 06, 2009 8:31 am
Reply with quote

Thanx, Terry.
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top