View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
I want to search particular string in a pds. i,e I want to include only those line which is not equal to string'program'
If it is a single member using below sort fields I can extract.
SORT FIELDS=COPY
INCLUDE COND=(1,80,SS,NE,C'PROGRAM')
But I have more than 100 members in my pds.
Could you please help me in this regard?
Regds,
useit |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, you can execute the same step 100 times.
DFSORT can read individual members of a PDS/E, when the members are specified in the JCL and just treated as an ordinary sequential dataset.
If you do a search of the forum, here and JCL, you'll find some suggestions for alternatives depending on what you want to do. |
|
Back to top |
|
|
charanmsrit
New User
Joined: 25 Oct 2007 Posts: 81 Location: Australia
|
|
|
|
Your requirement is best achieved by SuperC utility in batch
Code: |
// JOB
//SEARCH EXEC PGM=ISRSUPC,PARM=('SRCHCMP,ANYC')
//NEWDD DD DSN=USERID.PDS,DISP=SHR
// DD DSN=USERID.PDS2,DISP=SHR
//OUTDD DD DSN=output dsn
//SYSIN DD *
SRCHFOR 'PROGRAM'
/*
//
|
use the output DSN in the next step (probably SORT based on your requirement) to remove unwanted data and process further |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I feel this is could be achieved better using REXX |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
srch for 'program' would list all the members which has string 'program' . but i need those members which doesnt have string"Program"..
Regds,
useit |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Quote: |
srch for 'program' would list all the members which has string 'program' . but i need those members which doesnt have string"Program".. |
This is very much a rexx problem now
Search REXX forum for samples |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
useit wrote: |
srch for 'program' would list all the members which has string 'program' . but i need those members which doesnt have string"Program".. |
One more reason to use SuperC, which can easily be run from within a rexx program.
Among others, check the process options: LNFMTO (List not-found member or data set totals only), NOPRTCC, NOSUMS (they make it easier for rexx to process output). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
OK, so SUPERC gives you all of the members with the search word in, so you get the full library listing and ignore those with, and you are left with only those members without.
Just ran a test on Marsos suggestion ................... even easier |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
something like
Code: |
****** ***************************** Top of Data ******************************
- - - - - - - - - - - - - - - - - - - 2 Line(s) not Displayed
000003 //ISR EXEC PGM=ISRSUPC, *
000004 // PARM=(SRCHCMP,'LNFMTO')
000005 //NEWDD DD DISP=SHR,DSN=<YOUR PDS>
000006 //OUTDD DD SYSOUT=(*)
000007 //SYSIN DD *
000008 SRCHFOR '<YOUR SEARCH STRING>'
000009 /*
****** **************************** Bottom of Data **************************** |
will list all the members where the string is not found |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Nice Marso and tested |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
thanks a lot enrico..i have tested this and it is working for me.
is it possible to copy only those line/record which has that string?
say for example i have pds which has some 100 members. i want to search for perticular string and copy only those line which has that string.
thanks in advance
Regds,
useit |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Do you just need the record with string in output or do you need the member names aswell? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I wonder if you might tell us what you are trying to achieve, rather than just carry on asking for little bits at a time? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
a YES/NO question deserves a YES/NO answer ...
YES You can do it
go to ISPF option 3.15, hit ( without hurting it ) the PF1 key
and scroll thru the help panes to arrive at
Code: |
Tutorial ----------- Extended Search-For - Process Options ---------- Tutorial
Command ===>
This is a list of the Search-For process options. To see a description of any
particular option, type in that option name on the command line and press
enter. A detailed list can be obtained by pressing enter to continue to the
next panel.
ALLMEMS ANYC APNDLST CKPACKL COBOL DPACMT DPADCMT DPBLKCL
DPCBCMT DPCPCMT DPFTCMT DPMACMT DPPLCMT DPPSCMT FINDALL FMSTOP
IDPFX LMTO LNFMTO LONGLN LPSF LTO
MIXED NOPRTCC NOSEQ NOSUMS SDUPM SEQ XREF
(continued on next page)
|
where You can read about the options of srchfor. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Hi Bill,
Have you ever see the cartoon with Charlie Brown and Lucy and the football?
Well, you are Charlie Brown and Useit is Lucy pulling the football away from you once again.
Look at the old posts by this TS and see how many times he has done this.
Good entertainment I must say. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
All I've done is told Lucy to put the ball down and kick it herself, 100 times, and since originally Lucy wanted the ball to go in one direction, and now in another, I've asked if we might know what is supposed to be achieved with the ball, so that we can tell whether kicking is needed. Perhaps even whether the ball is needed... |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I understand totally. I follow this site daily, but only contribute occasionally.
Some TS just don't get it, and probably never will.
Charlie Brown has never kicked the ball. Lucy always wins. |
|
Back to top |
|
|
|