Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Search string from concatenated input files

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

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Sat Mar 30, 2019 9:51 pm    Post subject: Search string from concatenated input files
Reply with quote

Hi,
I am trying to search for a string from multiple input PS files and if string is found in any datasets, i want that the dataset from the concatenated input datasets to be reflected in the sysout.

I used
Code:

//SEARCH  EXEC PGM=ISRSUPC,                       
//            PARM=(SRCHCMP,                       
//            'ANYC')                 
//NEWDD  DD DISP=SHR,DSN=INPUT FILE1       
//        DD DISP=SHR,DSN=INPUT FILE2         
//        DD DISP=SHR,DSN=INPUT FILE3         
//        DD DISP=SHR,DSN=INPUT FILE4 
//        DD DISP=SHR,DSN=INPUT FILE5
//OUTDD  DD SYSOUT=(A)                           
//SYSIN DD  *                                     
SRCHFOR 'STRING'                                 
/*                                                 
                 


While doing so, if the string is found in any of the input files,it is returning code RC 01 but i cannot able to find which input file has the searched string out of other input files.
What i get is,if the searched string is found,its showing the last input file in the sysout but not the exact input file where the searched string is.
I assume all input files are concatenated and taking as whole one input file.

Is there any way to get the exact input file where the searched string is present from the concatenated input file.

Thanks.
Back to top
View user's profile Send private message

steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 738
Location: The Universe

PostPosted: Sun Mar 31, 2019 7:49 pm    Post subject: Re: Search string from concatenated input files
Reply with quote

srini24 wrote:
...
I assume all input files are concatenated and taking as whole one input file.

Is there any way to get the exact input file where the searched string is present from the concatenated input file.

Thanks.
  • I assume all input files are concatenated and taking as whole one input file.

    Yes, that is the way sequential input concatenation is supposed to work.

  • Is there any way to get the exact input file where the searched string is present from the concatenated input file.

    Technically, yes, it can be done, but it is slightly complicated. It must be done in Assembler. The ISPF version of SUPERC appears to be written in PL/S, which is sort of Assembler, but whether the code to extract the concatenation is in the code I cannot say.
Back to top
View user's profile Send private message
srini24

New User


Joined: 14 Feb 2017
Posts: 12
Location: India

PostPosted: Mon Apr 01, 2019 12:54 am    Post subject: Reply to: Search string from concatenated input files
Reply with quote

Is there any other way to achieve this on?
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 471
Location: Maryland

PostPosted: Mon Apr 01, 2019 4:33 am    Post subject: Re: Reply to: Search string from concatenated input files
Reply with quote

srini24 wrote:
Is there any other way to achieve this on?

Split your single job step into five sequential steps.

Never try to make things more complicated than they really are.

* * * * *

DD-concatenation has been introduced specifically to make multiple files looking as one single file. There is no simple way to find separate concatenated files except writing your own SUPERC in Assembler.

If you really want to do this, you're welcome.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1159
Location: Vilnius, Lithuania

PostPosted: Mon Apr 01, 2019 4:08 pm    Post subject: Re: Search string from concatenated input files
Reply with quote

steve-myers wrote:
srini24 wrote:
...
I assume all input files are concatenated and taking as whole one input file.

Is there any way to get the exact input file where the searched string is present from the concatenated input file.

Thanks.
  • I assume all input files are concatenated and taking as whole one input file.

    Yes, that is the way sequential input concatenation is supposed to work.

  • Is there any way to get the exact input file where the searched string is present from the concatenated input file.

    Technically, yes, it can be done, but it is slightly complicated. It must be done in Assembler. The ISPF version of SUPERC appears to be written in PL/S, which is sort of Assembler, but whether the code to extract the concatenation is in the code I cannot say.

I'm sure it is, as searching concatenated PDS'es can not only search multiple same-named members (SDUPM), but also show from which of the concatenated PDS'es the particular member comes:

Code:
  ISRSUPC   -   MVS/PDF FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY- ISPF FOR z/OS         2019/04/01   5.34    PAGE     1
 MEMBER  CONC#  LINE-#  SOURCE LINE        SRCH DSN: PRINO.RAHP.D.PLI

LIFT     (01)      820   %filler: proc returns(char);                                           00820000

LIFT     (03)      850   %filler: proc returns(char);                                           00850000

  ISRSUPC   -   MVS/PDF FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY- ISPF FOR z/OS         2019/04/01   5.34    PAGE     2
     SEARCH-FOR SUMMARY SECTION            SRCH DSN: PRINO.RAHP.D.PLI

LINES-FOUND  LINES-PROC  MEMBERS-W/LNS  MEMBERS-WO/LNS  COMPARE-COLS  LONGEST-LINE
        2        33815            2              1           1:72           80

PROCESS OPTIONS USED: LONGLN ANYC SEQ NOPRTCC CKPACKL SDUPM IDPFX

THE FOLLOWING PROCESS STATEMENTS (USING COLUMNS 1:72) WERE PROCESSED:
   srchfor '%filler'
   SELECT LIFT

THE FOLLOWING "SRH" FILE CONCATENATED DATA SETS WERE SPECIFIED:
 (01) PRINO.RAHP.PLI
 (02) PRINO.RAHP.CNTL
 (03) PRINO.RAHP.D.PLI
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1316
Location: Israel

PostPosted: Mon Apr 01, 2019 4:29 pm    Post subject: Reply to: Search string from concatenated input files
Reply with quote

As Prino said, everything you need is already in the result:

At the end of the report you have:
Code:
THE FOLLOWING "SRH" FILE CONCATENATED DATA SETS WERE SPECIFIED:
   (1) HLQ.SPF.JCL
   (2) HLQ.SPF.PROCLIB     
   (3) HLQ.SPF.CNTL2
   (4) HLQ.OPER.JCL
and the report itself shows the CONCAT#
With IDPFX, the number in parenthesis to the right of the member name:
Code:
********************************* TOP OF DATA ******
  ISRSUPC   -   MVS/PDF FILE/LINE/WORD/BYTE/SFOR COM
 MEMBER  CONC#  LINE-#  SOURCE LINE        SRCH DSN:
                                                   
MEMBER08 (4)         7  //CICSPA   EXEC PGM=CPAMAIN
                                                   
MEMBER27 (2)         7  //CICSPA   EXEC PGM=CPAMAIN

Without IDPFX, the number in parenthesis after the word CONCAT#:
Code:
MEMBER08 CONCAT#(4)       ----------- STRING(S) FOUND -------------------
                                                                         
     7  //CICSPA   EXEC PGM=CPAMAIN                                     
                                                                         
MEMBER27 CONCAT#(2)       ----------- STRING(S) FOUND -------------------
                                                                         
     7  //CICSPA   EXEC PGM=CPAMAIN                                     
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 471
Location: Maryland

PostPosted: Mon Apr 01, 2019 5:35 pm    Post subject:
Reply with quote

Older versions of SUPERC (still widely used) do not provide detection of concatenated datasets... icon_rolleyes.gif
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 33
Location: NY

PostPosted: Mon Apr 01, 2019 10:46 pm    Post subject:
Reply with quote

Without knowing what it is that the original poster intends to do with the results list, I would build a personal dataset list and then issue the srchfor command on the command line while in that list. Its manual but it gets the job done fairly easily.

The result will be the messages in which dataset the search term was found.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1159
Location: Vilnius, Lithuania

PostPosted: Mon Apr 01, 2019 11:31 pm    Post subject:
Reply with quote

sergeyken wrote:
Older versions of SUPERC (still widely used) do not provide detection of concatenated datasets... icon_rolleyes.gif

I don't think so, see the EOS dates on the IBM site.


FWIW, the output I posted predates all the the dates in the IBM document by probably another five years and it's an ADCD. No sane organisation would run such old version of z/OS or ISPF!
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
No new posts Send text at cursor position on an IS... Domenic Ailati CLIST & REXX 10 Sun Jun 02, 2019 7:34 am
No new posts Copy physical Tape files to a Mainfra... Dadi Krishna Teja JCL & VSAM 11 Thu May 16, 2019 10:25 pm
No new posts How to force PULL to read user-input ... Andi1982 CLIST & REXX 5 Thu May 09, 2019 6:27 pm
No new posts Split input file into multiple files ... srini24 DFSORT/ICETOOL 1 Sat Mar 30, 2019 9:39 pm
No new posts count the number of records from diff... janmejay CA Products 4 Mon Mar 25, 2019 11:29 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us