Thanks Kris, I will look forward to trying this. 

-----Original Message-----
From: CMSTSO Pipelines Discussion List <[email protected]> On Behalf 
Of Kris Buelens
Sent: Monday, February 4, 2019 11:43 AM
To: [email protected]
Subject: Re: How to output line number of locate

External Email

One more word: the fact that you use ' >> FINDIT OUTPUT A' means that for each 
file you searched, the ouput file is opened too.  So, if searching lots of 
files this is considerable overhead.  One v-can solve this, but that requires a 
much more elaborate pipe.

You could also have a look at my LOOK tool.
  
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.vm.ibm.com%2Fdownload%2Fpackages%2Fdescript.cgi%3FGD-XEDIT&amp;data=02%7C01%7CTim.Joyce%40alexlee.com%7C088f1e2a8f3e4c1290a008d68abfe9ad%7Cf56f06473fc041c399e8eec81bb9f9f6%7C0%7C0%7C636848954216042686&amp;sdata=rrj02JBukFp%2FDY3dKMb%2BQ%2BK6R58NeNyEG1XQnrCTb1c%3D&amp;reserved=0
You start it from withing FILELIST and it searches the files in the FILELIST; 
you can store the result in a disk resident file, but by default I store the 
result in an XEDITed workfile (work performed by LOOK XEDIT).
The workfile gets some special PF-keys set, for example to XEDIT the file 
pointed too with the cursor, around the matched lines (done by LOOKE XEDIT).  
There is also LOOKC XEDIT that even allows global changes, starting from 
withing the workfile.  The 3 macro's contain some usage info inside them, but 
start by reading LOOK XEDIT Remember a couple

Kris Buelens,
     --- VM/VSE consultant, Belgium ---
-----------------------------------------------------------------------


Op ma 4 feb. 2019 om 16:33 schreef Kris Buelens <[email protected]>:

> What about this
> '<' fn ft fm,             /* Input file                  */
> '|SPECS Recno 1 1-* 11',   /* add recordnr *.
> '| locate AnyCase 11-* ~'strg'~',      /* Locate the string           */
> '| specs ~'inrec'~ 1 1-130 25',  /* File info                   */
> '| >> FINDIT OUTPUT A '    /* Put results in file         */
>
> Kris Buelens,
>      --- VM/VSE consultant, Belgium ---
> ----------------------------------------------------------------------
> -
>
>
> Op ma 4 feb. 2019 om 16:19 schreef Tim Joyce <[email protected]>:
>
>> Hey Guys,
>>
>>
>>
>> I'm not a skilled plumber. I'm much more familiar with CMS REXX. Many 
>> years ago I created a FINDIT EXEC REXX program in CMS that 
>> programmers use often to search CMS members for a specified string. I 
>> later migrated to use Pipelines I/O rather than EXECIO as pipelines 
>> is much more storage friendly. Here is a sample of the locate and specs used 
>> for output:
>>
>>
>>
>> '<' fn ft fm,             /* Input file                  */
>>
>> '| casei locate ~'strg'~',      /* Locate the string           */
>>
>> '| specs ~'inrec'~ 1 1-130 25',  /* File info                   */
>>
>> '| >> FINDIT OUTPUT A '    /* Put results in file         */
>>
>>
>>
>> Sample output :
>>
>>
>>
>>   Searched '* JCL C' for 'PGM=FTP'  Ignore Case
>>
>>
>>
>>
>> 000000000111111111122222222223333333333444444444455555555556666666666
>> 77777777778
>>
>>    Files Found
>> 123456789012345678901234567890123456789012345678901234567890123456789
>> 01234567890
>>
>> ---------------------
>> ---------------------------------------------------------------------
>> -----------
>>
>> CIGL1000 JCL      C1    // EXEC PGM=FTP,SIZE=(FTP,256K),PARM='IP=FPRD'
>>
>> CIGL1005 JCL      C1    // EXEC PGM=FTP,SIZE=(FTP,256K),PARM='IP=GLPROD'
>>
>> CIGL1021 JCL      C1    // EXEC PGM=FTP,SIZE=(FTP,256K),PARM='IP=IFHHICK'
>>
>>
>>
>> It has been requested that I also output the line/record number that 
>> the string was found on (as some members locate strings in multiple 
>> locations).
>> I have been looking through pipelines reference but have not figured 
>> out the best way to do this without a lot of additional preprocessing 
>> of input data. Any suggestions would be appreciated.
>>
>>
>>
>> Tim Joyce
>>
>> Alex Lee Inc.
>>
>> Systems Administrator
>>
>

Reply via email to