IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Search string from concatenated input files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 917
Location: The Universe

PostPosted: Sun Mar 31, 2019 7:49 pm
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
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Apr 01, 2019 4:33 am
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: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Apr 01, 2019 4:08 pm
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: 1353
Location: Israel

PostPosted: Mon Apr 01, 2019 4:29 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Apr 01, 2019 5:35 pm
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: 42
Location: NY

PostPosted: Mon Apr 01, 2019 10:46 pm
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: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Apr 01, 2019 11:31 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top