View previous topic :: View next topic |
Author |
Message |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Tue Mar 09, 2004 10:18 am Post subject: Using 3.13 to search for a number. |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Mar 09, 2004 10:27 am Post subject: |
|
|
How about using the extended search (3.15) and searching for '123' as a WORD? |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Tue Mar 09, 2004 10:37 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Mar 09, 2004 10:44 am Post subject: |
|
|
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 |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Tue Mar 09, 2004 10:50 am Post subject: |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Mar 10, 2004 8:30 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 10, 2004 9:39 am Post subject: |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Mar 10, 2004 12:14 pm Post subject: |
|
|
Interesting ....
Thanks for the info. |
|
Back to top |
|
 |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Wed Mar 17, 2004 4:25 pm Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 17, 2004 5:40 pm Post subject: |
|
|
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 |
|
 |
vini Intermediate
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
|
Posted: Wed Mar 17, 2004 5:54 pm Post subject: |
|
|
Thanks kolusu !!!
The 'S *' is really coool , how I despised using the Tab
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 17, 2004 5:57 pm Post subject: |
|
|
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 |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Sep 05, 2008 9:32 am Post subject: Does this help - ISRSUPC |
|
|
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. 8)
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
 |
|
|