Reply=0
Output from command ====>
dos2unix: converting file /ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG to UNIX format ...
dos2unix: problems renaming './u2dtmpkESNiS' to '/ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG'
output file remains in './u2dtmpkESNiS'
dos2unix: problems converting file /ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG
The temporary file ./u2dtmpkESNiS is getting created in the DS Project directory and the actual file in the input folder is getting deleted.
I ran the same command at the prompt in Unix. It ran perfectly fine.
The issue is happening only when its being run in DS. Could there be a permission problem of writing the temp file from Project dir back to the actual dir?
a.) I tried writing to a different file but the same problem exists.
b.) The DS user has complete permissions to write to the folder.
I was mulling over the thought of how to redirect the temp file being created in the <Project> folder to /tmp folder. Isnt this supposed to happen by default. i.e. the creation of temp file in /tmp ?
Can I ask a dumb question? Why are you bothering with dos2unix? DataStage can import it. The only thing you need to do is make sure your import takes the final Ctrl-M character into consideration. IMHO, this would be more efficient - one less step to deal with before your data is parallel-ized (is that a word) in DataStage.
If you really need to do it outside of DataStage, you could do it with anything - C, Perl, KSH, sed, awk, etc. Here's a simple Perl script:
#!/usr/bin/perl
# File: mydos2unix.pl
# Description: Remove Ctrl-M chars from DOS files to use in Unix.
$^I = '';
LINE: while(<>) {
s/\015//; # Trim Ctrl-M characters
print "$_";
}
The first call does an in-place edit - that is, the original file will be modified. The second call will create a new file that has been edited, and leave the original file intact.
If you are very sure it's not concerned with UNIX permission, check the file name quotation: DataStage reads your command and may interpret and pass a different command to UNIX.
For example, './u2dtmpkESNiS' and "./u2dtmpkESNiS" are different things to UNIX and the last one is what you are after.
durgaps wrote:Facing an issue while converting dos files to unix files using the dos2unix command. The sequence finishes with the following log message.
Reply=0
Output from command ====>
dos2unix: converting file /ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG to UNIX format ...
dos2unix: problems renaming './u2dtmpkESNiS' to '/ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG'
output file remains in './u2dtmpkESNiS'
dos2unix: problems converting file /ds_data/METL/JOBS/WBTKEY/OUTPUT/HPCMTULDKEY_20061127101636.LOG
The temporary file ./u2dtmpkESNiS is getting created in the DS Project directory and the actual file in the input folder is getting deleted.
I ran the same command at the prompt in Unix. It ran perfectly fine.
The issue is happening only when its being run in DS. Could there be a permission problem of writing the temp file from Project dir back to the actual dir?
As you were thinking about a permission problem, I asked the way you were running DS, because depending on this, the profile loaded can change. When you run DS in command line with your profile (witch is not dsadm), jobs are running with the dsadm environment variables. So you may need to create some environment variables in dsadm profile and/or user defined environment variables with the Administrator.