cancel
Showing results for 
Search instead for 
Did you mean: 

File permission generated by bcp utility

Former Member
0 Kudos

Hello guys.

I already read some other forums and articles in the Internet, but nothing that I found helped me.

Could you please try to help me?

- There is an application job executing the bcp utility (with -e option) and inserting data into a table

- The permission of the file is being wrongly generated. It should be 644, but the file is created as 400

- The application team cannot read the file as they are using different Ids from the one used by the batch job

- We already tried to use the filemode option, change the umask to 022, change the OS Id to different groups, etc. None of them worked.

- The ASE version is 15.7 SP136

- The application team says the issue started happening after the upgrade from ASE 15.0.2 to 15.7

- Although this is just an ordinary error file, Customer want us to fix the issue as we're responsible for their environment. We could simply add a chmod command after the bcp and change the permission.

- I already connect to the Unix server using the Id used by the batch job and executed the bcp out command and the file was correctly generated (for both ASE V15 versions)

- The Unix team opened a PRM and already performed all the activities suggested by the 2nd level support

Do you guys have another suggestion?

Thanks.

Sergi

Former Member
0 Kudos

Hi Mark

Thanks for the answer.

The strange thing is that bcp out is generating the permissions according to the umask. We've tried changing the umask and it worked fine too. Only the -e option is generating the permissions in a wrong way.

Accepted Solutions (0)

Answers (1)

Answers (1)

jayrijnbergen
Active Participant
0 Kudos

on Linux, bcp version for ASE 15.7 SP136 includes new option --filemode

by default it creates file with permission 640, using --filemode you can change it

looks like umask is completely ignored by bcp

value for --filemode is like specifying it with chmod, e.g. --filemode 644

Former Member
0 Kudos

Hi Jeroen

Thanks for the answer.

I've already tried --filemode with no success 😞

jayrijnbergen
Active Participant
0 Kudos

did some tests on Linux (RHEL 6.6) with SP136

file permissions are combination of --filemode and umask settings

both output and error file have permissions as set with --filemode, limited by umask

did you already try setting both umask and --filemode ?

and what Unix are you on?

Former Member
0 Kudos

Hi

The batch job contains the umask command at the beginning and I included the --filemode 644 in the bcp command. So the answer would be yes.

The batch job also called a setup script and we also inserted the umask command in it.

Server is AIX 6.1

ryan_hansen
Contributor
0 Kudos

Hi,

Can you try:

umask 0

bcp master..test out output -c -Usa -Psybase -Sredhead --filemode 644

Regards,

Ryan