8

I have a search I'd like to run against a zOS dataset, and I know how to form the grep command. I have access to the machine via Unix system services, how to I address a dataset from that environment?

4
  • 2
    +1 I think it is the first z/OS question around here :) – kubanczyk Feb 3 '12 at 21:26
  • 1
    @kubanczyk I've got plenty more if you want them ... – C. Ross Feb 4 '12 at 1:04
  • Absolutely - I don't think we have many z/OS folks but good questions would go a long way to attracting them :) – voretaq7 Feb 4 '12 at 1:23
  • some doubts are cleared after reading this question. thanks – Premraj Nov 12 '17 at 7:48
5

No need to cp first. You can cat, tail, grep etc. The thing to remember is the special quoting and that the DSN is preceded by two slashes:

cat "//'s052WX.EO.REXX(MYREXXSOURCE)'" | grep parse

If you look in the UNIX command reference manual under the cp command there’s more info.

3

How big a data set are we talking about?
The Unix system services cp command can take data sets as a source, and a Unix file (or directory) as a target, so conceivably if the data set is small enough you can copy it into files and grep away to your heart's content.

As an alternative, if you can open your data set in ISPF on the z/OS machine you may want to consider using FINDRX (which gives ISPF basic regex capability) -- I've never used it myself though so I can't vouch for it working or not.

1
  • The data sets aren't that big (COBOL source), but there are 200+ of them ... – C. Ross Feb 4 '12 at 1:05
0

As far as i know there are two options:

  1. Copy files to uss-filesystem and grep there as mentioned above; works for me.

  2. Create an external link (~ /usr/sbin/mount -f host.quali.pda -O 'SYNC(120)' mountpoint) and grep via that link; currently not working for me because of rights-restrictions.

The cat-suggestion works well for a single file, but not for all pds-members (at least i was not able to make it work).

0
  • z/OS supports UNIX (Single UNIX Specification) APIs and applications through USS (UNIX System Services).
  • The Open Group certifies z/OS as a compliant UNIX operating system – with UNIX/Linux-style hierarchical HFS and zFS file systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.