Showing posts with label Mainframe. Show all posts
Showing posts with label Mainframe. Show all posts

Monday, 11 March 2013

FREE TSO command


FREE TSO command:


FREE is used to deallocate ddnames or data sets which were allocated using ALLOC command. It basically does opposite of ALLOC.

Free one or more ddnames:
FREE DD(ddname)
FREE DD(ddname1 ddname2 etc.)

DDNAMES are generally associated with a dataset using ALLOC.
IF we use FREE with the ddname then that association is broken.

Free one or more data sets:
FREE DSN(datasetname)
FREE DSN(datasetname1 datasetname2 etc.)


FROM HELP:
 
 FUNCTION -                                                          
   THE FREE COMMAND DYNAMICALLY UNALLOCATES A DATA SET, AN HFS       
   FILE AND/OR DELETES AN ATTRIBUTE LIST. IT MAY ALSO BE USED TO     
   CHANGE OUTPUT CLASS OF SYSOUT DATA SETS FOR IMMEDIATE             
   AVAILABILITY FOR PROCESSING BY AN OUTPUT WRITER IN ADDITION TO    
   UNALLOCATING THEM OR TO CHANGE THE SYSOUT HOLD QUEUE              
   SPECIFICATION. A DISPOSITION MAY BE ENTERED TO OVERRIDE THE       
   DISPOSITION SPECIFIED AT ALLOCATION.                              
                                                                     
 SYNTAX -                                                            
          FREE   DATASET('DSLIST') FILE('DDLIST')                    
                 ATTRLIST('ALNLIST')                                 
                 OUTDES('OUTDLIST')                                  
                 DEST('STATIONID')                                   
                 HOLD/NOHOLD                                         
                 KEEP/DELETE/CATALOG/UNCATALOG/SYSOUT('CLASS')       
                 ALL                                                 
              PATH(PATHNAME)                          
              PATHDISP(OVERRIDE-DISPOSITION)          
              SPIN(UNALLOC | NO)                      

REQUIRED-  EITHER DSNAME OR DDNAME OF ANY DATA SETS TO BE UNALLOCATED AND/OR ATTR-LIST-NAME OF ANY ATTRIBUTE LISTS TO BE DELETED, AND/OR OUTDES NAME LIST, OR ALL KEYWORD.         

ATTRIUTE LISTs Are created by using the command ATTRIB

NOTE    -  IF NO OVERRIDING DISPOSITION IS SPECIFIED, DATA SETS   
           ARE DISPOSED OF IN MANNER SPECIFIED WHEN ALLOCATED.    
        -  THE OPERAND 'DATASET' MAY ALSO BE SPECIFIED AS 'DSNAME'.
           THE OPERAND 'FILE' MAY ALSO BE SPECIFIED AS 'DDNAME'.  

DATASET('DSLIST') OR DSNAME('DSLIST') - DSLIST IS LIST OF DSNAMES OF DATA SETS TO BE       
                   UNALLOCATED.                                       
 
FILE('DDLIST') OR DDNAME('DDLIST') - DDLIST IS LIST OF DDNAMES ASSOCIATED WITH DATA                        SETS TO BE UNALLOCATED.                            
 
ATTRLIST('ALNLIST') - ALNLIST IS LIST OF ATTR-LIST-NAMES OF ATTRIBUTE LISTS TO BE DELETED.         

Following indicate the kind of disposition to be used for datasets while freeing.
If we dont specify anything then the ones used while allocating is used.

KEEP - DATASET DISPOSITION IS KEEP. IGNORED FOR SYSOUT.                     
 
DELETE - DATASET DISPOSITION IS DELETE.                                     

Example:

alloc ddname(input1) dsn('sm017r.testfile') OLD
free ddname(input1) delete  --> will delete the dataset sm017r.testfile.
If while allocating we had used the disposition  as SHR, then the FREE DELTE will not work.

CATALOG - DATASET IS TO BE CATALOGED. IGNORED FOR SYSOUT.                   
 
UNCATALOG - DATASET IS TO BE UNCATALOGED. IGNORED FOR SYSOUT.               
 
ALL - ALL DYNAMICALLY ALLOCATED DATASETS, FILES AND ATTRIBUTE LISTS         
      ARE TO BE UNALLOCATED.  

TSO DELETE command



TSO DELETE command:

Used to delete a dataset.

Delete a member: DELETE datasetname(member)
Delete a data set: DELETE datasetname

 READY  delete 'm0001.testfile'                     
                                                      
 IDC0550I ENTRY (A) M0001.TESTFILE DELETED          
 READY                                               
                                                     

FROM HELP:
 
 Function -                                                                     
   The DELETE command is used to delete either VSAM objects or NONVSAM         
   data sets from a VSAM or ICF catalog and to free space occupied by          
   the objects or data sets. Also the free space of VSAM data components       
   can be overwritten with zeros. The DELETE command also deletes              
   GDG bases and VSAM USERCATALOGS.                                            
                                                                                
                                                                               
 Syntax -                                                                      
          DELETE    ('entryname/password' ...)                                 
                    CATALOG('catname/password')                                
                    FILE('dname')                                              
                    PURGE | NOPURGE                                            
                  ERASE | NOERASE                                           
                  SCRATCH | NOSCRATCH                                       
                  FORCE | NOFORCE                                           
                  RECOVERY | NORECOVERY                                      
                  MASK | NOMASK                                             
                  CLUSTER | SPACE | USERCATALOG |                           
                      ALIAS | GENERATIONDATAGROUP | PAGESPACE |              
                      NONVSAM | PATH | ALTERNATEINDEX | TRUENAME |          
                      NVR | VVR | VOLUMEENTRY | LIBRARYENTRY                
                                                                            
Defaults - NOPURGE     
           SCRATCH     
           NOFORCE     
           NORECOVERY  
           NOMASK      

Following are the abbreviations that can be used:

 DELETE               DEL                 
 PURGE                PRG                 
 FORCE                FRC                 
 NOFORCE              NFRC                
 NOPURGE              NPRG                
 NOERASE              NERAS               
 NOSCRATCH            NSCR                
 RECOVERY             RCVRY                
 NORECOVERY           NRCVRY              
 SPACE                SPC                 
 USERCATALOG          UCAT                
 GENERATIONDATAGROUP  GDG                 
 PAGESPACE            PGSPC               
 NONVSAM              NVSAM                
 ALTERNATEINDEX       AIX                 
 TRUENAME             TNAME               
 LIBRARYENTRY         LIBENTRY LIBENT     
 VOLUMEENTRY          VOLENTRY VOLENT     
                                          
Operands -                                               
'entryname/password'                                  
           - Specifies the name of entry to be deleted. 
'entryname'                                                      
         - Name of entry to be deleted.                          
'password'                                                       
         - Password for password-protected cluster, page space,  
           catalog, alternate index, or path.                    


CATALOG('catname/password')                                               
         - Specifies the name of catalog containing the entries to be    
           deleted.                                                      
'catname'                                                                 
         - Name of catalog containing the entries to be deleted.         
'password'                                                               
         - Master level password of the catalog.                         
Required - 'catname'                                                     

                                                                         
FILE('dname')                                                            
         - Specifies the location of the object to be deleted.           
'dname'  - Name of the DD statement that identifies either the volume    
           containing the object to be deleted or the data set to be     
           deleted.  Can be used when we know the DDNAME to be deleted.
                                                    
FORCE    - The object is to be deleted even though not empty.

NOFORCE  - The object is not to be deleted if it is not empty.         
                                                                        
PURGE    - The object is to be deleted regardless of expiration date.  
                                                                       
NOPURGE  - The object is not to be deleted before expiration date.      
                                                                       
ERASE    - The data component of the cluster is to be overwritten      
           with binary zeros.                                          
                                                                        
NOERASE  - The data component of the cluster is not to be overwritten  
           with binary zeros.                                          
                                                                        
SCRATCH  - The non-VSAM data set being deleted from the catalog is to  
           be removed from the VTOC of the volume on which it resides.

MASK     - The entryname is a MASK filter used to select a range 
           of catalog entries to be deleted.                     
                                                                 
NOMASK   - the entryname is the name of a catalog entry to be    
           deleted.                                              
                                                                  
CLUSTER  - The entry to be deleted is the entry for a cluster.   

SPACE    - The entry to be deleted is the entry for a data space.          
           Required if applicable.                                          
                                                                           
USERCATALOG                                                                 
         - The entry to be deleted is the entry for a user catalog.        
           Required if applicable.                                         
                                                                           
ALIAS    - The entry to be deleted is the entry for an alias.              
                                                                            
GENERATIONDATAGROUP                                                         
         - The entry to be deleted is the entry for a generation data      
           group.                                                           
                                                                           
PAGESPACE                                                                   
         - The entry to be deleted is the entry for a page space.          
                                                                            
NONVSAM  - The entry to be deleted is the entry for a non-VSAM data        
           set.                                                            
                                                                            
PATH     - The entry to be deleted is the entry for a path.                
                                                                           
ALTERNATEINDEX -                                                            
           The entry to be deleted is the entry for an                     
NVR      - The entry to be deleted is a non-VSAM volume record.      
           required if applicable.                                   
                                                                      
VVR      - The entry to be deleted is a VSAM volume record.          
           Required if applicable.                                   
                                                                     
LIBRARYENTRY                                                         
         - The entry to be deleted is a library entry.               
           Required if deleting a library entry.                     
                                                                      
VOLUMEENTRY                                                          
         - The entry to be deleted is a volume entry.                
           Required if deleting a volume entry.                       

TSO CALL command


TSO CALL command:

Used to execute a Load Module- Binary executable form of program which was previously link edited.

If the first qualifier of the data set name containing the load module does not match your PREFIX (typically your userid) or if the last qualifier is not LOAD, the data set name must be fully qualified and enclosed within single quotes on the command line.

Syntax:
CALL 'fullyqualfiedname(loadmodulename)' 'parameters'

Example:

CALL 'cmn.test.baso.lod(mytest1)' 'X,0,CCCC'

The above call function will call the program mytest1. We are also passing parameters to the program.
If the program uses input and output files the program will fail while opening the file as we have not allocated any datasets. This can be done using the ALLOCATE or ALLOC command prior to calling the program.

If the program needs a Input file to be associated with a ddname INPUT1, then following is how we execute the program

ALLOCATE DDNAME(INPUT1) DSN('sm107r.test.input') SHR
CALL 'cmn.test.baso.lod(mytest1)' 'X,0,CCCC'

 FROM HELP:
 FUNCTION                                                                 
   The CALL command loads and executes programs in executable form.       
                                                                          
 SYNTAX -                                                                 
                                                                          
          CALL   'dsname(member)' 'parm'                                  
                 CAPS/ASIS   NOENVB/PASSENVB                              

Defaults:
MEMBER - If no MEMBER is specified, TEMPNAME is used.     
CAPS   - the PARM parameter string is to be translated to uppercase.                                         
NOENVB - The REXX environment block address is not to be passed to the program in register 0.               
                                                            
Operands:
CAPS     The CAPS operand indicates that the parameter string
     'PARM' is to be translated to uppercase before the called program executes.       This is the default.                
                                                                       
ASIS     The ASIS operand indicates that the parameter string          
         'PARM' should not be translated to uppercase before           
         the called program executes.                                  
                                                                       
NOENVB   The NOENVB operand indicates that the REXX environment        
         block (ENVBLOCK) address is not to be passed to the called    
         program in register 0.  This is the default.                  
                                                                       
PASSENVB The PASSENVB operand indicates that the REXX environment      
         block (ENVBLOCK) address is to be passed to the called        
         program in register 0.                                        

dsname(member) - The name of a partitioned data set and the member which     
           is to be executed                                           

'parm'   - Specifies a parameter string (up to 100 characters)         
           that is passed to the program to be executed.