Building off Jim's approach:
userid = 'AAA'
'PIPE',
'| < MY LISTING A', /* Read in datafile */
'| FRTARGET FIND 0' || userid, /* Start at first record for user */
'| NLOCATE 1-6 /1REPT:/', /* Strip headers */
'| NLOCATE 1-6 /DATE:/', /* "" */
'| NLOCATE 1-6 /TIME:/', /* "" */
'| NLOCATE 1-9 /========/', /* "" */
'| NLOCATE 1-7 /0USERID/', /* "" */
'| JOINCONT LEADING / / /!/', /* Put all user info together */
'| FIND 0' || userid, /* Get info for target user */
'| SPLIT BEFORE /!/', /* Get back to multiple lines */
'| CHANGE /!/ /', /* Revert our continuation character */
'| CONS' /* Display output */
This should also be a bit more tolerant than your initial solution when it comes to intervening records (e.g. throw an 0AAA FULL02 after the second header, and your pipes will give you a lot of extra junk).
Regards,
Miguel Delapaz
z/VM TCP/IP Development
- A more elegant pipe? Huegel, Thomas
- Re: A more elegant pipe? Hughes, Jim - OIT
- Re: A more elegant pipe? Schuh, Richard
- Re: A more elegant pipe? Miguel Delapaz
- Re: A more elegant pipe? Miguel Delapaz
- Re: A more elegant pipe? Hughes, Jim - OIT
- Re: A more elegant pipe? Schuh, Richard
- Re: A more elegant pipe? Brian Nielsen
- Re: A more elegant pipe? Huegel, Thomas
- Re: A more elegant pipe? Schuh, Richard