Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Search particular string in a pds

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Mon May 13, 2013 6:09 pm    Post subject: Search particular string in a pds
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon May 13, 2013 6:18 pm    Post subject: Reply to: search perticular string in the pds
Reply with quote

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
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 80
Location: Australia

PostPosted: Mon May 13, 2013 6:23 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon May 13, 2013 6:26 pm    Post subject:
Reply with quote

I feel this is could be achieved better using REXX
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Mon May 13, 2013 6:56 pm    Post subject: Reply to: search perticular string in the pds
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon May 13, 2013 7:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Mon May 13, 2013 7:16 pm    Post subject: Re: Reply to: search perticular string in the pds
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon May 13, 2013 7:33 pm    Post subject:
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 13, 2013 7:36 pm    Post subject: Reply to: search perticular string in the pds
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon May 13, 2013 7:39 pm    Post subject:
Reply with quote

Nice Marso and tested icon_smile.gif
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 141

PostPosted: Tue May 14, 2013 1:30 pm    Post subject: Reply to: search perticular string in the pds
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue May 14, 2013 1:49 pm    Post subject:
Reply with quote

Do you just need the record with string in output or do you need the member names aswell?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue May 14, 2013 2:10 pm    Post subject: Reply to: Search particular string in a pds
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 14, 2013 2:13 pm    Post subject: Reply to: Search particular string in a pds
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue May 14, 2013 5:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue May 14, 2013 6:17 pm    Post subject: Reply to: Search particular string in a pds
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue May 14, 2013 6:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us