IBM Support

Dataonly option with the admin command line - usage tips

Troubleshooting


Problem

The admin command line client returns the output of administrative commands along with some header information. This header information may not be desirable. The dataonly option can be used to only return the data portion of the admin command.

Resolving The Problem

The IBM Tivoli Storage Manager administrative client provides a command line option named "-dataonly=no/yes" which offers a way to obtain the data portion of the output only. This can be useful when redirecting the output to a file that can later be used as input to a macro file. Examples are provided below.

A) Using -dataonly=no (default), the following command :
dsmadmc -id=admin -pa=password select process_num from processes
may give the following output :

IBM Tivoli Storage Manager
Command Line Administrative Interface - Version 7, Release 1, Level 1.0
(c) Copyright by IBM Corporation and other(s) 1990, 2014. All Rights Reserved.
Session established with server MYSERVER: AIX
Server Version 7, Release 1, Level 1.0
Server date/time: 09/26/14 08:24:27 Last access: 09/25/14 14:21:00

ANS8000I Server command: 'select process_num from processes'
PROCESS_NUM
-----------
5
7
ANS8002I Highest return code was 0.

B) Using -dataonly=yes, the same command, i.e,
dsmadmc -id=admin -pa=password -dataonly=yes select process_num from processes
would give just the process numbers, i.e,

5
7

C) Now, it is possible to use the -dataonly=yes option and a macro file to facilitate doing such things as cancelling all running TSM processes. For example :

  • In a macro file (e.g. tsm.mac), put the following command :
    select 'cancel process '||cast(process_num as char(4)) from processes
  • Run this macro as follows :
    dsmadmc -id=admin -pa=password -dataonly=yes macro tsm.mac > temp.mac
  • The temp.mac file now contains the cancel process commands in a macro format which can be run as is with the following :
    dsmadmc -id=admin -pa=password -itemcommit macro temp.mac
This would result in cancelling all running processes on the TSM server.

[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Client","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]

Document Information

Modified date:
17 June 2018

UID

swg21143748