TSM select query randomly creating extra line feeds

Arledge

Newcomer
Joined
Jul 30, 2012
Messages
2
Reaction score
0
Points
0
TSM query creating extra line feeds randomly

All,

I am currently writing some scripts that output data from TSM and input them into a database table on a webserver for a monitoring suite. So far everything has been going well, until I came across this anomaly.

To simplify the issue, the problem can be replicated as below.

If I run the following I get a file created that is TAB delimited of the SELECT statement.

dsmadmc -id=XXXX-pa=XXXX-dataonly=y -displaymode=table -tabdelimited ' select VOLUME_NAME,NODE_NAME,FILESPACE_NAME,FILE_NAME,FILE_SIZE,SEGMENT,FILESPACE_ID,COPIED,DAMAGED from CONTENTS' >testfile

The strange thing happens on a few lines during the output. Instead of having just a TAB after the file name, a LINEFEED is inserted before the TAB. Below is an example where the issue is with file3.

A00001 hostname /gpfs/filesystem01 /dir1/dir2/file1 21770 1/1 1 No No
A00002 hostname /gpfs/filesystem01 /dir1/dir2/file2 6332 1/1 1 No No
A00003 hostname /gpfs/filesystem01 /dir1/dir2/file3
472 1/1 1 No No
A00004 hostname /gpfs/filesystem01 /dir1/dir2/log/file4 10038 1/1 1 No No
A00005 hostname /gpfs/filesystem01 /dir1/dir2/log/file5 6332 1/1 1 No No

The problem does not occur after a certain amount of lines or characters, but occurs at the same place every time the script is run.

Has anyone seen this before or know of an issue?
 
Last edited:
Have you tried to run this with the -outfile=filename option instead of > testfile? I ran across a problem like this once where I had to add
"-outfile=filename.csv -outfile" to the options to get it to work. Got that recommendation from TSM advanced support. Not sure why -outfile has to be there twice, once with and once without a file name, but that solved my output problems.
-Rowl
 
Hi Rowl,

I have tried this with output=filename and still get the same result.

I have however noticed that for the files that are playing up, there are two entries in the TSM database. Apart from the TAB being LF-TAB & the file sizes being different the entries look the same.

When I then look at files using the command "select * from contents where file_name='/dir1/dir2/file3' there is only 1 entry.

Maybe I have a corrupt database.
 
Back
Top