John22439
ADSM.ORG Member
Good morning All!
I was wondering if anyone can explain why my script does not create any output other than "in new file" ??
I am running this on a windows box connecting to an MVS TSM Server. I have other batch files that do work. My theory is that you cannot do mathematical calculations in a batch script?
Here is my script - the SQL works fine in a command console
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
set today=%date:~10,4%-%date:~4,2%-%date:~7,2%
set t2=%time:~0,5%
if not exist D:\output/sessions/ses_Mbps_%today%.txt goto CREATE_FILE
(same as below with chevrons to output to ... D:\output/sessions/ses_Mbps_%today%.txt)
goto END
:CREATE_FILE
echo %t2% > D:\output/sessions/ses_Mbps_%today%.txt
echo in new file > D:\output/sessions/ses_Mbps_%today%.txt
dsmadmc -id=TSM_TOOL -password=TSM_TOOL "select session_id,client_name,state,(cast((current_timestamp-start_time)minutes as decimal(10,0))),(cast((cast((((bytes_sent*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0))) as INT)),(cast(cast((((bytes_received*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0)) as INT)) from sessions" >> D:\output/sessions/ses_Mbps_%today%.txt
:END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ADMIN script that I run on the TSM Server works fine (below) but I am trying to record the data on an hourly basis.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select session_id,client_name,state,cast((current_timestamp-start_time)minutes as decimal(10,0)) as "Elapsed minutes",cast((cast((((bytes_sent*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0))) as INT) as "Mbps sent",cast(cast((((bytes_received*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0)) as INT) as "Mbps recvd" from sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help or knowledge would be great!
Cheers,
j
I was wondering if anyone can explain why my script does not create any output other than "in new file" ??
I am running this on a windows box connecting to an MVS TSM Server. I have other batch files that do work. My theory is that you cannot do mathematical calculations in a batch script?
Here is my script - the SQL works fine in a command console
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo off
set today=%date:~10,4%-%date:~4,2%-%date:~7,2%
set t2=%time:~0,5%
if not exist D:\output/sessions/ses_Mbps_%today%.txt goto CREATE_FILE
(same as below with chevrons to output to ... D:\output/sessions/ses_Mbps_%today%.txt)
goto END
:CREATE_FILE
echo %t2% > D:\output/sessions/ses_Mbps_%today%.txt
echo in new file > D:\output/sessions/ses_Mbps_%today%.txt
dsmadmc -id=TSM_TOOL -password=TSM_TOOL "select session_id,client_name,state,(cast((current_timestamp-start_time)minutes as decimal(10,0))),(cast((cast((((bytes_sent*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0))) as INT)),(cast(cast((((bytes_received*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0)) as INT)) from sessions" >> D:\output/sessions/ses_Mbps_%today%.txt
:END
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ADMIN script that I run on the TSM Server works fine (below) but I am trying to record the data on an hourly basis.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
select session_id,client_name,state,cast((current_timestamp-start_time)minutes as decimal(10,0)) as "Elapsed minutes",cast((cast((((bytes_sent*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0))) as INT) as "Mbps sent",cast(cast((((bytes_received*8 )/1024)/1024) as decimal(18,0)) /cast((current_timestamp-start_time)seconds as decimal(18,0)) as INT) as "Mbps recvd" from sessions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any help or knowledge would be great!
Cheers,
j