You are here: Home > Knowledge Refreshers

KR-33 Saving the spool

 

We'll take a look at how to save the spool into a dataset. Perhaps you might know this already!!

  • There are some occasions where it would be very useful if we could save the spool into a dataset.
  • For example: When you run a search in Endevor you'll find a listing of all the elements in the spool along with the return code (0000 means that the search string was found in that element and any other return code indicates that the string isn't present in that element).
  • Scanning through a huge list and trying to locate 0000 will take sometime (maybe even a lot of time and is prone to errors).
  • Instead you can save the spool into a dataset and then use INS/ a sort step to extract records containing 0000.
  • So, let's say that in the SD;ST option we want to save the listing present in SYSPRINT.
  • Type 'xdc' in the first column and press enter.
  • We'll be taken to another screen where you'll have to specify the properties of the dataset where the content should be stored.

KR-34 A>0 or 0>A???

 

Many a times we end up wondering whether A>0 or 0>A (in COBOL as well as in DB2). The following should clear your doubts on the subject:

  • 3 LESS THAN 4 
  • A LESS THAN B 
  • AB LESS THAN B 
  • ABC LESS THAN ABD 
  • A LESS THAN 0 
  • AB3 GREATER THAN ABC

Thus numbers are greater than alphabets. The same holds good in DB2 as well.

 

NOTE: This is the case of numbers being stored as characters. We can't otherwise compare a numeric field with a character field.

 


KR-36 BMC for views

 

There are times when you might need to find out how a "view" was created in the database. BMC can be used for this purpose.

Checking descriptions of views and tables:

Go to BMC -> 2.) CATALOG MANAGER and then choose OBJ TYPE as VW (for a view) - the same process can be applied to tables as well.

Prefix the view/table name by MX (mixed). And you'll be taken to another screen listing the tables and views.

Here you can use a 3-character command. Type DES (describe) to view the details of the table/view.

In the case of a view you will also get the query which was used to create the view.

The command US prefixed before the view name will give a list of users who are authorized to use the view and what authority they have.