Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create a new text file in IBM i IFS directory

Tags:

ibm-midrange

How do you create a new text file in IBM i (as/400) Integrated File System (IFS) from green screen command line or maybe in ACS or Navigator tools?

I usually just copy an old file, but I realized I don't know create a new file using IBM i command. No F6=Create option in WRKLNK. Going through on line help was not productive.

  CPY OBJ('/home/myFile.txt') TOOBJ('/home/NEWUSER/MyNewFile.txt')
like image 889
Mustapha George Avatar asked Oct 17 '25 10:10

Mustapha George


2 Answers

If you just want a text file, you can use EDTF to create an empty IFS file and open an editor against it. So:

EDTF 'test.txt'

will create a file named test.txt in the IFS in your home directory which is usually /home/<user name>.

like image 90
jmarkmurphy Avatar answered Oct 20 '25 22:10

jmarkmurphy


Another alternative is to use the QSH command and run the touch shell command.

QSH CMD('touch /path/to/ifs/file.txt')

You can add the '-C nnnn' parameter if you want to set the CCSID of the file that is created.

like image 25
David G Avatar answered Oct 20 '25 21:10

David G



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!