Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

overwrite in Application server

Former Member
0 Likes
2,586

hi all,

i need to send the output to application server, the data was going perfectly but the problem is ,the report if we run twice the output should not overwrite with the first executed run in app server.

if we run run more than once also it shoud not overwrite.

please help me

5 REPLIES 5
Read only

Former Member
0 Likes
1,257

Hi,

If we download output to application server with the same file name earlier file will be overwritten.

To avoid this concatinate current date or time or some thing else to the file name.

I added date with the file name as it is executed on daily basis.

Thanks & Regards,

Sudheer

Read only

Former Member
0 Likes
1,257

I would add further what sudheer said.

You cannot avoid overwriting if the files have same name.

Make some logic to change the file name everytime.....

Read only

Former Member
0 Likes
1,257

Just append the current date and time at the end of the file name that you are writing to the app. server. This will write a unique file each time the report is run.

Read only

Former Member
0 Likes
1,257

Hi,

If you want the contents of the file to be written to the same file without overwriting the existing data, then use the ... FOR APPENDING addition of the open dataset statement.


open dataset dsn ........ FOR APPENDING 

Otherwise do as suggested above by adding a date time stamp to the filename.

regards,

Advait

Read only

former_member404244
Active Contributor
0 Likes
1,257

Hi

as suggested by ravi

"Just append the current date and time at the end of the file name that you are writing to the app. server. This will write a unique file each time the report is run."

I feel this is the good option.

Regards,

Nagaraj