Assign nothing to a file in the script

Hello everybody,

In Mainframe, when I want to assign nothing to an output file created by a cobol program in a JCL, I do:

CUSTOMER DD DUMMY.

How can I do this in my script unix ?

Thanks in advance!
Best regards

Hi

Like sending the output to nowhere? >>/dev/null
or like creating and empty file? touch somenamefile

If you add the first after any command line in your script, the output of that command will not be seen on screen or registered on log.

Regards

Thanks Ikaro0,
I tried but same issue. I got a file called 'null'.

I want to send my file to nowhere. Actually, I use in the script an export statement that puts the output to a given address. I'd want to change it. I'd want to send the output to nowhere.

best regards

Hi Nolo41

/dev/null is a null device, a special file that discard any data written to it.
From Wikipedia:

/dev/null - Wikipedia, the free encyclopedia

If you type like

echo test >> /dev/null 

You will send test to nowhere.

What error do you get?

Regards.

Thanks Ikaro0,

I got no error. As you told me, the null file is created and it discards any data writen in it. It is empty.

However, I am looking for an output without creating any file. Is that possible ?

Thanks again

Hi Nolo41, the null file has not been created by you, it exist in UX systems.

1 Like

Great! Thanks Ikaro0 !
Best regards