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

3.14 scan with preceding and subsequent lines for a string


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Sat Jan 28, 2012 5:14 pm
Reply with quote

Hi Everyone,

This is a part of COBOL program in a dataset.

Code:
            MOVE WS-B TO WS-A,                 
                      WS-C,                 
                      WS-D.                 
            MOVE B TO WS-D,                 
                      WS-B,                 
                      WS-C.       


I want to do 3.14 or 3.15 search for the string WS-B.
If the string is present in the middle of a sentence, i want to have that complete sentence in my output... no matter how many lines that sentence is splitted up in the code like the move statements above which have three lines each. So for the above part, 3.14 search should produce all 6 lines in the output.
Which PARM can i pass in the Searchfor utility to achieve this ? Could some one can help on this ?
Thanks in advance.
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Sat Jan 28, 2012 5:22 pm
Reply with quote

You cannot, SuperC is not clairvoyant-enabled.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jan 28, 2012 5:41 pm
Reply with quote

Best you can get is if you can get 2-3 lines before and after the match.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sun Jan 29, 2012 4:42 am
Reply with quote

Hi,

how do you identify the start or end of a sentence ?


Gerry
Back to top
View user's profile Send private message
sureshmurali
Warnings : 1

New User


Joined: 25 Nov 2010
Posts: 70
Location: Sivakasi, India

PostPosted: Sun Jan 29, 2012 7:53 am
Reply with quote

The begining of a sentence can be identified by a COBOL keyword and its end can be by a full stop. But full stop may not be required and is optional. But its continuation can be tracked by a comma at end of a line or a hyphen at the position 7.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Jan 29, 2012 5:01 pm
Reply with quote

Comma does not inidicate a continuatipon. The "-" is not "necessary" unless continuing a literal and can be avoided.

Why you'd expect a comparison product to be able to emulate compilers, I don't know.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Jan 29, 2012 8:53 pm
Reply with quote

By default, SuperC will print only the lines where the string was found.

If you specify the process option LPSF, it will list 6 lines before and 6 lines after.
If you want more (or less) lines, you can use the process statement LPSFV followed by the number of lines you want to see (between 1 and 50).

These are the only possibilities.
And they are available only in 3.15, not in 3.14
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top