Page 1 of 1

Problems in source code migrated from LINUX to AIX

Posted: Wed May 16, 2012 7:04 am
by abhishekachrekar
Hi,

We have migrated our project from LINUX box to AIX box.

In one of the DS routine we have are performing some operations using unix commands.

This commands works fine in DS routine on LINUX box but it doesn't works on AIX box.
The unix commands works fine if i run it directly from the AIX box.
But it doesnt work when run from DS routine. It doesn't throw any error though.

The command is:
OsType = 'UNIX'

OsCmd = "tr -d '\000\001\002\003\004\005\006\007\010\011\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177' < ":FILENAME:" > ":NEWFILENAME
OsCmd := '; perl -i~ -pe "s/\x92/':REPLACECHAR:'/g" < ':NEWFILENAME:' > ':FILENAME:';rm ':NEWFILENAME
Call DSLogInfo('Command is : ':OsCmd ,'rtTrimNonPrintableChars')
Call DSLogInfo('Converting file: ':DIR_PATH:'/':FILE_NAME,'rtTrimNonPrintableChars')
Call DSExecute(OsType,OsCmd,OsOutput,OsStatus)


Kindly advise what can be the issue. I think the OsType needs to be changed but I dont know the value for AIX server.

Posted: Wed May 16, 2012 4:38 pm
by ray.wurlod
"Doesn't work" doesn't help.

What error is thrown?

I suspect that the parent directory for "perl" is not in your command search list (that is, the PATH environment variable).

Posted: Thu May 17, 2012 2:09 am
by abhishekachrekar
Hi Ray,

As mentioned before, there is no error thrown. The same command works fine directly from the AIX box but not from the DS routine.
The routine returns status '0' (success) but the result of the operations (tr command and pearl) is not visible in the final output file.

Regards,
Abhisek

Posted: Thu May 17, 2012 7:19 am
by abhishekachrekar
Hi,

I found the work around.

Replaced the first tr statement with a perl statement.

OsCmd = "tr -d '\000\001\002\003\004\005\006\007\010\011\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\177' < ":FILENAME:" > ":NEWFILENAME

Replaced with
OsCmd = 'perl -i~ -pe "s/[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F]//g" < ':FILENAME:' > ':NEWFILENAME

But its indeed strange why the tr statement runs correctly directly from the AIX box but not from the DS routine.