You are here: Home > Knowledge Refreshers

KR edition 157,160,161


KR-157 : MEM command - contributed by Wreet


Hi everyone,

Getting back into techie editions we shall start off with a tip...

The MEM (member) command can be used in TSO option 3.4 (i.e. datasets listing screen) to find out whether a member is present within any of the PDSes listed on the screen.

Just type:

                 M member-name

on the command line and press enter.

We can also use wildcards in this. For example: to search for a file starting with TEST we can use the command:
                M TEST*

The member command will only search within the PDSes that are not migrated.

To search in migrated datasets as well append the keyword RECALL1 or RECALL2 (RECALL 1 stands for MIGRAT1 while RECALL2 is for MIGRAT2). The system will actually recall all the migrated datasets and then search for the member within them.

If the member is found within the PDS then those PDSes will be marked. Try it out.



KR-160 : SeaRCH FOR ? command - contributed by Sachin


We enter the 160 mark with this edition and we have a TSO tip for today;

As Wreet pointed out the MEM (member) command can be used to find out whether a member is present within any of the PDSes listed on the screen.

So what if we want to find if a string is present in a number of PDSes in a single search?

The SRCHFOR command comes to our resuce.

  • In TSO option 3.4 (i.e. datasets listing screen) list out the PDSes in which you want the search to be done. 

  • Give ‘SRCHFOR’ in the command line. 

  • In the new screen give your Search string 

There are a lot of options which make the utility more powerful - options include any Case Search, Mixed mode etc. which can be selected with a ‘/’ (i.e. if you want to search using case or not).

  • Search migrated: Here you can choose to search in PDSes that are not migrated only, migrated at first level or all (similar to what we saw in the MEM command). 

  • Search exclude: What if you want to search for only in some of the PDSes listed? Just exclude them in the list using ‘X’ and select the option as required (the X should be marked in the PDS listing screen before you type SRCHFOR and the option is selected in the SRCHFOR panel).

  • Select Display: Choose view output if you want to see the results (Member name, line no. and detail) or it will directly take you to the PDS listing screen with a message stating where all the string was found. 

Use the help panel on the SRCHFOR screen and you'll come across even more things that can be performed (like wanting to list out members where 2 strings are present on the same line).

Note: The MEM and SRCHFOR options can be made more powerful by using in conjunction with the APPEND command.


KR-161 : COMPare within a file - contributed by Sachin


What do you do if you want to compare 2 files?  Simple. 3.13 (option SUPER CE) right?
But 3.13 only gives you the differences in another screen. Wouldn’t it be nice to see the differences within the file itself? So what do we do?

Lets say we want to compare ‘TEST.SACHIN.NEW(NEWFILE)’ and ‘TEST.SACHIN.OLD(OLDFILE)’ 

  • Go in View or edit mode into one of the files say, ‘TEST.SACHIN.NEW(NEWFILE)’

  • In the command line give: COMP ‘TEST.SACHIN.OLD(OLDFILE)’

  • This will give the lines which are in the OLD file but not in NEW as ‘======’

  • Those in NEW but not in OLD are labeled as ‘.OAAAA’, ‘.OAAAB’ etc (you can go to these labels by giving L .OAAAB)

You might have noticed one problem, if the changes are few and far in between it won’t be very traceable. So is there a way to show only the changes with other lines excluded? Of course there is.


  • If you want to incorporate the lines which are in the OLD file but not in NEW, into the NEW file:
    Just give MD (line command) in the line marked by ‘======’. (If you want a block of lines to be incorporated, give block command MDD.) 

  • MD is the "make data" line command. 


  • We can see the changes from within the file itself, so that we know where exactly the changes are present wrt the entire code. (It would be very useful especially while testing output files) .

  • We can incorporate lines into the file.

  • Also when using the X (exclude parameter) we can see the context where the changes have been made (i.e. we can see a few lines before and after the change). 


  • As the Command line has only space for 48 chars, the COMP ‘<filename>’ can’t be used when the <filename> is very long.