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.
Problems in source code migrated from LINUX to AIX
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 45
- Joined: Wed May 02, 2007 8:30 am
- Location: Prague, Czech Republic
Problems in source code migrated from LINUX to AIX
Regards,
Abhishek
Abhishek
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
"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).
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).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 45
- Joined: Wed May 02, 2007 8:30 am
- Location: Prague, Czech Republic
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
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
Regards,
Abhishek
Abhishek
-
- Participant
- Posts: 45
- Joined: Wed May 02, 2007 8:30 am
- Location: Prague, Czech Republic
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.
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.
Regards,
Abhishek
Abhishek