99 Bottles of Beer (using REXX)
|This article isn't finished yet or needs to be revised. Please keep in mind that thus it may be incomplete.
Reason: Rephrase, reformat, set links and wade out unneccessary stuff.
Heiko knows Rexx from his OS/2 days and wanted to run "99 bottles of beer" as his first project.
Things you need:
- log in using a tn5250 terminal
- command prompt (you might need to change screens)
- maybe this for easy reference: Basic Commands
- Create a physical file to hold the script. This is described in the Hello World (using database, display file and RPG). I created a file named BOTTLES.
Create the script file
The next step creates a member named BOTT in source file BOTTLES that is stored in library HKRETSCHME.
Work with the BOTTLES file:
WRKMBRPDM FILE(HKRETSCHME/BOTTLES) MBR(BOTT)
…if you already created the BOTT member (=script object in BOTTLES source file).
Create the member BOTT: Hit F6 to bring up the options of STRSEU:
Insert the code:
Save the member by entering "Y" (here "J") in the first line.
STRREXPRC SRCMBR(BOTT) SRCFILE(BOTTLES)
- 99BOTTLES would have been nice, but filenames are not allowed to begin with numbers. Maybe NTYNBTLS would be a good alternate name?
- Members cannot have the same name as the physical source file (BOTTLES). Therefore the member is named BOTT.
- Alternatively use the STRSEU command.