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 

Using 3.13 to search for a number.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Tue Mar 09, 2004 10:18 am    Post subject: Using 3.13 to search for a number. Reply with quote

Hi,
I need to search for a number like 123 in all the programs in production. The program will have move statements like,

MOVE '123' TO WS-TEST-VAR.

I am trying to get all the programs that have 123. I tried with just 123 and I am getting all the line numbers, I tried with ''123''..its giving error.
Can somebody tell me a method to do this.

Regards,
KRK123
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Mar 09, 2004 10:27 am    Post subject: Reply with quote

How about using the extended search (3.15) and searching for '123' as a WORD?
Back to top
View user's profile Send private message
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Tue Mar 09, 2004 10:37 am    Post subject: Reply with quote

Hi SuperK,
I tried all the 3 possible combinations, i.e

1. 123,
2. '123' and
3. ''123'' - this its saying null string invalid.

with the first and second its picking the line numbers.

01230000
06612300
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 09, 2004 10:44 am    Post subject: Reply with quote

krk123,

You can specify the start and end positions for the search. Assuming that you are searching cobol program, you can give the search criteria as 7: 72 bytes. By doing so you are excluding the line numbers.

Here is a sample JCl for searching 123 anywhere in the cobol source.

Code:

//SEARCH  EXEC PGM=ISRSUPC,                                           *
//            PARM=(SRCHCMP,                                           
//            '')                                                       
//NEWDD  DD DSN=YOUR SEARCH DSN,
//          DISP=SHR                                                   
//OUTDD  DD SYSOUT=(*)                                                 
//SYSIN  DD *                                                           
SRCHFOR  '123'                                                         
CMPCOLM  7:72                                                           
/*   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Tue Mar 09, 2004 10:50 am    Post subject: Reply with quote

Kool..I guess this gives the results I am looking for.

Kolusu and SuperK thanks a lot for your time and help.

Regards,
KRK123
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Mar 10, 2004 8:30 am    Post subject: Reply with quote

Kolusu, once again I find myself stumped as to how you were able to reach your conclusion concerning this inquiry.

In 22 years in the business, I have never seen a data construct (QSAM, PDS, PDS/E, VSAM, BDAM) that included line numbers within the data, except for the occasional Quikjob programs, that would require the search to be restricted to the specified columns as you indicated.

Is there a special source code maintenance facility that is generating these lines numbers (i.e. Panvalet or SCLM or Endeavor)?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Mar 10, 2004 9:39 am    Post subject: Reply with quote

Superk,

I assumed that you are having a PDS which has cobol programs and for this pds I assumed that the profile is set to NUM ON STD COB. NUM ON STD COB maintains line numbers in cols 73-80 and expects valid sequence numbers in order. And the cobol code usually starts from col 8 thru 72.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Mar 10, 2004 12:14 pm    Post subject: Reply with quote

Interesting ....

Thanks for the info.
Back to top
View user's profile Send private message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Wed Mar 17, 2004 4:25 pm    Post subject: Reply with quote

How do we search for a literal ?

I could have the following occurences of 123 in my code
01 WSH-NUM123 PIC 9(9)
MOVE '123' TO ...

However, if I wish to target only lines where it appears as a constant , is there a way ?

I changed the JCL to ..SRCHFOR ''123'' ..but it doesnt work.

Also is there a way to use Wildcards in JCL for DD names ?! If I want to search a PDS where member names are prefixed with ASX* for example.
Any thoughts or solutions ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Mar 17, 2004 5:40 pm    Post subject: Reply with quote

vini,

If you want to search for the constant , you can search it as word. Also you can limit your choice to a specific pds also

choose option 3.15
Code:


 Command ===>                                               
                                                           

Search DS Name  . . 'YOUR PDS NAME'                                       
PDS Member List . . ASX*      (blank/pattern - member list, * - search all)   
                                                                             
(Leave Search DSN "blank" for concatenated-uncataloged-password panel)       
                                                                             
Enter Search Strings and Optional operands (WORD/PREFIX/SUFFIX,C)             
   Caps . .                                                                   
   Caps . .                                                                   
   Caps . .                                                                   
   Asis . .                                                                   
   Asis . .                                                                   
                                                                             
Listing DSN . . . . SRCHFOR.LIST                                             
Process Options . .                                                           
Statements Dsn  . .
                                                                             
Enter "/" to select option      Execution Mode          Output Mode           
   Bypass selection list        2  1. Foreground        1  1. View           
                                   2. Batch                2. Browse         


2.TYPE 'E' At the command prompt

it will bring the following screen
Code:

    Enter or change Process Statements in the EDIT window below:   
 ****** ***************************** Top of Data *****************
 000001                                                           
 000002                                                           
 ****** **************************** Bottom of Data ***************


Type in the following lines. you will find examples at the bottom of the scren
Code:

   Enter or change Process Statements in the EDIT window below:         
****** ***************************** Top of Data ***********************
000001 SRCHFOR  '123',W                                                 
000002 CMPCOLM  7:72                                                   
****** **************************** Bottom of Data *********************


3. Press PF03 and press ENTER.

Since you have given a pattern list for the members , it will show another screen with all the members. Now type S * and press ENTER at the command prompt or tab over to the left side of the member and type s to select the desired members.

4. press PF03 it will search for the constants if you choose interactive mode( see at the bottom of first slide) , or else you will prompted with a screen where you can specify the job card for batch mode.

5. press ENTER to submit the job

check the outdd for results.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Wed Mar 17, 2004 5:54 pm    Post subject: Reply with quote

Thanks kolusu !!!

The 'S *' is really coool , how I despised using the Tab Very Happy

I believe though you did not mention , the same can be done through changing the JCL you provided in this post. I have not yet tried the option where it would ask me for the Job card and submit a JCL , I guess I could use the generated JCL thereafter.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Mar 17, 2004 5:57 pm    Post subject: Reply with quote

Vini,

of course the same can be done with the JCL provided above only when you don't have the selection of members. If you look at the jcl generated with member selection,it will physically get all the member names matching the name pattern.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Sep 05, 2008 9:32 am    Post subject: Does this help - ISRSUPC Reply with quote

Hi,

If you want to search for '123' (including quotes) you can use the below batch job.

Code:

//SEARCH  EXEC PGM=ISRSUPC,             
//            PARM=(SRCHCMP,           
//            'ANYC')                   
//NEWDD  DD DSN=YOUR.INPUT.PDS, 
//          DISP=SHR                   
//OUTDD  DD SYSOUT=(*)                 
//SYSIN  DD *                           
SRCHFOR  '''123'''                     
/*                                     


Hope it helps. Very Happy 8)

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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