Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Edit Macro for finding an Blank Line in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 236

PostPosted: Thu Apr 02, 2009 4:48 pm    Post subject: Edit Macro for finding an Blank Line in a file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu Apr 02, 2009 4:55 pm    Post subject: Reply to: Edit Macro for finding an Blank Line in a file
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: 236

PostPosted: Thu Apr 02, 2009 5:16 pm    Post subject:
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    Post subject: Reply to: Edit Macro for finding an Blank Line in a file
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: 236

PostPosted: Thu Apr 02, 2009 6:41 pm    Post subject:
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: 1239
Location: Richfield, MN, USA

PostPosted: Thu Apr 02, 2009 9:29 pm    Post subject:
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    Post subject:
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: 1239
Location: Richfield, MN, USA

PostPosted: Sun Apr 05, 2009 10:45 pm    Post subject:
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    Post subject:
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: 1239
Location: Richfield, MN, USA

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

You're welcome. For the rest of the Extended Ascii Chart, see http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us