View previous topic :: View next topic |
Author |
Message |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Tue Aug 23, 2005 6:16 am Post subject: searching a string in a pds of Jcl + procs excluding comment |
|
|
searching a string in a pds of Jcl and procs excluding comments line.
a fileaid batch jcl which will search for a string in a PDS (contains jcl procs) containing around 400 members and return the member name and position of the string in that particular member.
This is working fine but I like to exclude comment lines.(//* or *)
Code: |
//FASTEP EXEC PGM=FILEAID,REGION=6M
//*TEPLIB DD DISP=SHR,DSN=SUPT.FILEAID.LOAD
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=Ak.COB.SRC,
// DISP=SHR
//DD01SC DD DSN=Ak.FILEAID.SC.T41(SELECT)
// DISP=(OLD,DELETE)
//SYSIN DD *
$$DD01 LIST FORM=JCL
/*
//
| [/code] |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 23, 2005 6:54 am Post subject: |
|
|
vak255,
Try the following Sysin cards.
Code: |
//SYSIN DD *
$$DD01 LIST IF=(1,0,C'your search string'),
AND=(1,NE,C'//*')
/*
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 23, 2005 7:16 am Post subject: |
|
|
vak255,
Alternatively you can use the option 3.14 or 3.15 to search dropping the comment lines. You use the parm DPLINE which exclude lines if "//*" found in columns 1:3
Code: |
//SEARCH EXEC PGM=ISRSUPC, *
// PARM=(SRCHCMP,
// '')
//NEWDD DD DSN=YOUR PDS TO BE SEARCHED,
// DISP=SHR
//OUTDD DD SYSOUT=(*)
//SYSIN DD *
SRCHFOR 'YOUR SEARCH STRING'
DPLINE '//*',1:3
/*
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Tue Aug 23, 2005 7:36 am Post subject: |
|
|
thanks kolusu, but the real problem is , how to drop the comments which are on the end of the statement...
Quote: |
//SEARCH EXEC PGM=ISRSUPC, *
// PARM=(SRCHCMP,
// '')
//NEWDD DD DSN=YOUR PDS TO BE SEARCHED, *comments
// DISP=SHR *comments
//OUTDD DD SYSOUT *comments
|
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 23, 2005 8:00 am Post subject: |
|
|
Quote: |
how to drop the comments which are on the end of the statement...
|
vak255,
huh ! I am lost here !
Do you want to drop the lines which has //* at the end of statement? Show us an example with a sample input and desired output !
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Tue Aug 23, 2005 8:33 am Post subject: |
|
|
sorry for the confusion.I want to exclude the comments , which I have underlined.I don't have the data now, anyway thanks for all the help.
Quote: |
//SEARCH EXEC PGM=ISRSUPC, *
// PARM=(SRCHCMP,
// '')
//NEWDD DD DSN=YOUR PDS TO BE SEARCHED, *comments
// DISP=SHR *comments
//OUTDD DD SYSOUT *comments
| [/code][/b] |
|
Back to top |
|
 |
|
|