Re: Redirecting Output In Scripts
Have you tried using the -outfile option? dsmadmc select blah blah blah -outfile=/dir/filename James Thompson _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Ref: Redirecting Output In Scripts
Thanks for all the replies to my query. Unfortunately, all the tips have failed miserably, so I have taken the script outside of TSM to produce my output file. (Running as an AIX script executing a dsmadmc command rather than internally within TSM). Thanks again Robin Lowe Senior Storage Analyst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Re: Redirecting Output In Scripts
Yeah, ADSM has some little idiosyncrasies that are hard to get used to. Most often, I'm working out the selects from shell scripts as so: REPORT="~/adsm.report" ID="foo" PW="bar" and later: BU_DATE=`dsmadmc -id=$ID -pa=$PW "select node_name,filespace_name from filespace s where cast((current_timestamp-backup_end) days as decimal)> 2 and (filespace_ type like 'ext2' or filespace_type like 'JFS')" | tail +13 |sed '/ANS8002I/d' |s ed '/^$/d' |awk {'print $1,$2'}` and finally: echo "Filespaces needing backup (>2 days without backup)" >$REPORT # To create file if neccessary echo "" >>$REPORT # to append file echo "$BU_DATE" >>$REPORT # to append file You may note that this script is comprised of two answers I got from "old-timers" right here on this list (if you've been following at all). It selects a group of nodes whose "backup end" date is greater than two days ago. Next, it strips the IBM header and the results footer. (a hack, I know, but it works) THe only place this is somewhat fishy is in reporting NTFS or FAT filesystems. As soon as the shell sees "\\", it freaks out. I fought with various escape sequences for days until I figured out I could just kill the declaration early in the file, and put the whole output in one place like so: echo " Win32" >>$REPORT dsmadmc -id=$ID -pa=$PW "select node_name,filespace_name from filespaces where cast((current_timestamp-backup_end) days as decimal)> 2 and (filespace_type like 'NTFS' or filespace_type like 'FAT' or filespace_type like 'API:NTEXC')" | tail +13 |sed '/ANS8002I/d' >>$REPORT echo " NetWare " >>$REPORT dsmadmc -id=$ID -pa=$PW "select node_name,filespace_name from filespaces where cast((current_timestamp-backup_end) days as decimal)> 2 and (filespace_type like 'NTW:LONG' or filespace_type like 'NDS')" | tail +13 |sed '/ANS8002I/d' >>$REPO RT That gives you the Win and Netware filesystems respectively. I'm sending reports to the UNIX, NT, and ORACLE teams by conditioning against FS type. Hope that helps! Jerald Sheets, Systems Analyst TIS Our Lady of the Lake Regional Medical Center 5000 Hennessy Blvd, Baton Rouge, LA 70808 Ph.225.765.8734..Fax.225.765.8784 E-mail: [EMAIL PROTECTED] -Original Message- From: Robin Lowe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 6:32 AM To: [EMAIL PROTECTED] Subject: Redirecting Output In Scripts I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Re: Redirecting Output In Scripts
... >SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE > 'DM.PROD.ADSMP.VOLUSAGE' ... >However, in the TSM server on AIX, a similar command defined as a script and >then run issues an ANR2907E Unexpected SQL operator token - '>'. A frequently asked question... Admin Ref manual chapter 3, Redirecting Command Output addresses this. And from my notes at http://people.bu.edu/rbs/ADSM.QuickFacts : > Redirection character in the server administrative command line interface, if at least one space on each side of it, saying to replace the specified output file. There is no "escape" character to render this character "un-special", as a backslash does in Unix. Thus, you should avoid coding " > " in an SQL statement: eliminate at least one space on either side of it. Richard Sims, BU
Re: Redirecting Output In Scripts
Looks like the syntax routines has a slight bug in it... now where the admin client should be able to deal with the redirect, you may pull it out of TSM and make AIX deal with it by using something along the lines of : (note "eval") #!/bin/ksh ... eval dsmadmc -id=blah -pass=blah select node_name, volume_name from volumeusage > /adsmlogs/output.file 2>&1 ... exit then rather than passing the "> /adsmlogs/output.file" to tsm for processing, AIX deals with it... hope this helps... later, Dwight -Original Message- From: Robin Lowe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 6:32 AM To: [EMAIL PROTECTED] Subject: Redirecting Output In Scripts I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Re: Redirecting Output In Scripts
Robin, It will work if you put your query in double quotes, dsmadmc -id=name -pa=pass "select node_name,volume_name from volumeusage" > /adsmlogs/output.file -Original Message- From: Robin Lowe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 6:32 AM To: [EMAIL PROTECTED] Subject: Redirecting Output In Scripts I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Re: Redirecting Output In Scripts
This is from memory but this has been asked before. As I remember ( and it is going fast) you need to remove the spaces around the ">". Or maybe after the ">". Sorry that I don't remember more. -- Phillip Ford Senior Software Specialist Corporate Computer Center Schering-Plough Corp. (901) 320-4462 (901) 320-4856 FAX [EMAIL PROTECTED] -Original Message- From: Robin Lowe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 6:32 AM To: [EMAIL PROTECTED] Subject: Redirecting Output In Scripts I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent. *** This message and any attachments is solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use, or distribution of the information included in this message is prohibited -- please immediately and permanently delete this message.
Re: Redirecting Output In Scripts
I am not familiar with SQL queries but the first thing I would try is to separate the Query with quotes select "node_name, volume_name from volumeusage" > /adsmlogs/output.file Or something to that effect. I think looking at documentation on the select statement should help to better answer your question. -Original Message- From: Robin Lowe [mailto:[EMAIL PROTECTED]] Sent: Monday, July 02, 2001 7:32 AM To: [EMAIL PROTECTED] Subject: Redirecting Output In Scripts I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Re: Redirecting Output In Scripts
I found that running dsmadmc on my Win95 workstation I'd have to not put in the space after the > symbol - ex: select node_name, volume_name from volumeusage >d:\temp\vols.out Nick Cassimatis [EMAIL PROTECTED] Today is the tomorrow of yesterday. Robin Lowe cc: Sent by: "ADSM: Subject: Redirecting Output In Scripts Dist Stor Manager" <[EMAIL PROTECTED] DU> 07/02/01 07:32 AM Please respond to "ADSM: Dist Stor Manager" I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.
Redirecting Output In Scripts
I am having a bit of bother routing output from a script to a file in an AIX environment. (I am fairly new to AIX having been an MVS/OS390 junky for 20 odd years !) Currently we have an ADSM 3.1.2.50 (yes I know we are out of support - upgrade to TSM 4.1 pending !!) on OS390 and an AIX server at TSM 3.7.2. In the ADSM server, I can execute a SELECT command in Batch TSO Admin as follows : SELECT NODE_NAME,VOLUME_NAME FROM VOLUMEUSAGE - > 'DM.PROD.ADSMP.VOLUSAGE' The output goes to the OS390 dataset as expected. However, in the TSM server on AIX, a similar command defined as a script and then run issues an ANR2907E Unexpected SQL operator token - '>'. eg : select node_name, volume_name from volumeusage > /adsmlogs/output.file If you run the same command in a command line admin client session (dsmadmc), the command does redirect the output okay !! How can I get the output redirected in a script ? I want to automate several scripts, redirecting the output to files which I can post-process on OS390 with SAS. Thanks Robin Lowe Senior Storage Analayst For more information on Standard Life, visit our website http://www.standardlife.com/ The Standard Life Assurance Company, Standard Life House, 30 Lothian Road, Edinburgh EH1 2DH, is registered in Scotland (No SZ4) and regulated by the Personal Investment Authority. Tel: 0131 225 2552 - calls may be recorded or monitored. This confidential e-mail is for the addressee only. If received in error, do not retain/copy/disclose it without our consent and please return it to us. We virus scan all e-mails but are not responsible for any damage caused by a virus or alteration by a third party after it is sent.