ls -m behaving strangely

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Novak
Participant
Posts: 97
Joined: Mon May 21, 2007 10:08 pm
Location: Australia

ls -m behaving strangely

Post by Novak »

Hi all,

I was hoping somebody would have come accross this very strange behaviour of 'ls -m' command executed from the Execute Command stage and is able to help me.
There is a list of files in DEV environment that I want to retrieve that are meant to be delimited by commas and later handled by a loop. The problem arises when the list of files is produced but no commas are included. This proven by the output that can be seen in Director's log of the job. The following loop does what its meant to and processes 1 file only (had the commas been included it would process them all).
Whats strange is that when the actual command 'ls -m' (parameters replaced by values) is copied from director and executed on Unix, the list of files with commas included is the resulting output.
Whats more strange even, is that this exact same job is run on 2 other environments (SIT and UAT on a different unix box to DEV) and it works like a clock.
I know it would be possible to consider some of the other delimiters to solve this small problem, but it is only the DEV box this is not working on and as mentioned before we have it functioning on the subsequent environments. It is just that it is intriguing and I would not mind knowing what could possibly cause this?

Thanks & Regards,

Novak
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Does your command use any quote characters and, if so, of what kind? Can you post the complete command and parameters fields from your Execute Command activity?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Have you involved your SysAdmins, the ones responsible for the O/S on those boxes? And please post the complete log entry which shows the command being executed.
-craig

"You can never have too many knives" -- Logan Nine Fingers
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Convert The Filed Mark Value in a user variable activity

Code: Select all

Convert(@FM,"",ExecuteCommand.$CommandOutput) 
Regards
LakNar
Novak
Participant
Posts: 97
Joined: Mon May 21, 2007 10:08 pm
Location: Australia

Post by Novak »

Hi,
Can you post the complete command and parameters fields from your Execute Command activity?
It is a no Ray, no quote characters. This is the actual command copied from Director:

ls -m /apps/etl/dev/datainput/archive/reference_data/80241_*.dsv
Have you involved your SysAdmins, the ones responsible for the O/S on those boxes? And please post the complete log entry which shows the command being executed.
The answer to involving SysAdmins is no Chullet. Have not gone anywhere yet. Just tried to extensively test this.
The result from running the above command is as:

/apps/etl/dev/datainput/archive/reference_data/80241_Employee_20090907_164221.dsv
/apps/etl/dev/datainput/archive/reference_data/80241_General_Calendar_20090907_164223.dsv
/apps/etl/dev/datainput/archive/reference_data/80241_Global_Parameter_20090907_164229.dsv

The above is just the small part of all the files that get listed, but as you can see the delimiting comma between them is missing. Small reminder - the exact copy of the job working fine in the subsequent environments.

Thanks,

Novak
Novak
Participant
Posts: 97
Joined: Mon May 21, 2007 10:08 pm
Location: Australia

Post by Novak »

Guys,

Hopefully, nobody ever gets this same issue because I found it impossible to resolve. Since I posted last, the scenario is completely different with respect to the environments. All of sudden (for the reasons unknown to anybody) the job is working in DEV, but is not working in SIT.
So, instead of fearing this same scenario in future, I changed command from 'ls -m' to 'ls -1' (column listing) and handled the output in a later stage by converting @FM to a comma.

Regards,

Novak
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That is extremely odd but at least you have a workaround. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply