Working With IFS Stream Files from Green Screen
There are many cases in web services development where working with stream files in the IFS is required. This section describes the different green screen utilities available to you to accomplish the tasks at hand. Note that our recommended approach is to use IBM’s RDi/RDp/WDSC (Rational Developer / Websphere Development Studio Client), but that isn’t always available in all instances.
Creating Stream Files
There are a variety of reasons to create a stream file. The main reason concerning RPG API Express would be to create a Template Engine file (i.e. *.tpl). To do that you would simply issue the following command.
QSH CMD('touch -C 819 /www/myrxs/templates/newfile.tpl')
This is invoking the QShell environment and calling the touch command. The touch command will simply create the file if it doesn’t yet exist. The “-C 819” is specifying what CCSID should be used to create the file. To learn more about the syntax of touch please refer to the following URL: IBM Infocenter - touch
Editing Stream Files
Using the EDTF command you can edit a stream file residing in the IFS. The following can be used to edit the file created in the section above:
EDTF '/www/myrxs/templates/newfile.tpl'
Note that the entire path is enclosed in single quotes. These are required.
If you are unsure of the file name you can use wildcard characters. The following will display a listing of files that you can choose to edit by placing an option 2 next to the file (similar to SEU):
EDTF STMF('/www/myrxs/templates/*')
Working With Stream Files
If you are looking for a way to simply explore the directory structure of the IFS then use command WRKLNK. Below is an example of displaying all contents in folder /www/myrxs/templates :
WRKLNK '/www/myrxs/templates/*'
Another useful example would be to show how you can limit the results by specifying a partial file name. The below will only display files starting with “Order_111” that reside in the /www/myrxs/trans directory:
WRKLNK '/www/myrxs/trans/Order_111*'
Once the list of files in a directory is displayed, you can simply specify option 2 or 5 next to it to edit or display it respectively.
Displaying Stream Files
If you are looking for a way to display a stream file from the IFS then use command DSPF. The following will display the contents of a template file located in the IFS:
DSPF '/www/myrxs/templates/rxs3.tpl'