You are here: Home > Knowledge Refreshers

KR editions 99 to 101

KR-99 (ISRDDN) :

Did you know about the program ISRDDN?
1)Just type ISRDDN (or TSO ISRDDN) on the command line/option line and see what shows up. 

2)The program lists out the datasets which have been allocated to your userid along with their disposition (i.e. what access you have on the dataset- exclusive access/ shared access etc). 

3)Try it: Open a PDS (thro option 3.4) in browse/edit mode and then type ISRDDN on the command line. You'll find that the dataset you've just opened will be listed in the ISRDDN screen. 

4)There are a lot of options to explore in this screen. Just type HELP for the list of available commands. There is a command to free an allocated dataset; a command to compress the dataset etc. For example type a Q in the "action field column" and you can find out the list of jobs which are accessing that particular datset. 

5)Try it: Open a member of a PDS in edit mode and then type ISRDDN. In this screen, locate the PDS you've entered and type Q for the action-code. The next screen would list the jobs accessing this PDS and also whether any member of the PDS is being edited - you'll find that the member you've opened in edit mode will be listed in this screen. 

6)Explore and you'll learn more about ISRDDN.

Question by Rajat: How much do PIC S9(4) COMP-3 and PIC 9(4) COMP-3 occupy? Answers next week.

KR-100 (IEBCOPY) :

Last week's question by Rajat: How much do PIC S9(4) COMP-3 and PIC 9(4) COMP-3 occupy?

Answer: A COMP-3 always includes space for the sign. So even if we say PIC 9(4) COMP-3 it would occupy the same space as PIC S9(4) COMP-3 (i.e. 3 bytes). What's the difference? The difference is that the sign won't be stored in the 9(4) case. If we moved -1823 to both the variables then the S9(4) would contain: 01 82 3D while the 9(4) would contain: 01 82 3F (all are in hex format and in COMP3 each digit requires uses 4 bits of storage). A C denotes a positive sign while a D denotes a negative sign; but in the case of 9(4) variable no sign is stored (which is why it is F).

Did you know that IEBCOPY is the utility used for compressing datasets? A sample JCL for compressing would be:


The above JCL compresses the pds referred to in DDIN. Generally IEBCOPY is used to copy from one PDS to another but since in this case INDD and OUTDD point to the same PDS, it will compress the PDS. In fact even when you compress in foreground (through option 3.4 and then compress), it leads to the execution of IEBCOPY.


Did you know why in cobol codes we declare COMP-3 variables with odd number of digits (like S9(5) COMP-3 instead of S9(4) COMP-3)?

Based on yesterday's discussion we can answer this question. It's just a matter of wasted space. For example- we'd use PIC S9(5) rather than PICS9(4) and PIC S9(3) rather than PIC S9(2) - because when an even number of digits are stored, half a byte is wasted (why waste half a byte if you can accomodate an extra digit!). S9(4) requires 3 bytes (with half a byte being wasted) and S9(5) also requires the same 3 bytes!

Question from Elan: There are many cobol compilers. How do we find out which version we are using?
One simple way is to check out the compiler listing output produced when a cobol code is compiled. Right at the top of your listing you'll find details about your compiler version and make (i.e. on what operating systems it can be used).

The different cobol compilers in mainframes (from the oldest to the latest):


2.) COBOL for MVS and VM

3.) COBOL for OS/390 and VM

4.) Enterprise COBOL for z/OS and OS390

Actually all were created in the 1980s but VS COBOL II is not supported by IBM. And the second one is also outdated because mainframes nowadays don't use MVS (most places use OS/390 which supplanted MVS). 

So check out what compiler your system uses.


Go back to the main contents page