
To write “Hello World!” in the CL (IBM) programming language, you can follow these steps using the command line interface:
- Open a terminal or command prompt on your system and launch an IBM i session with CL. You may need to use the ‘ssh’ or ‘telnet’ commands for this purpose depending on your network setup.
If not already present, create a new CL library by typing “CRTLIB LIB(yourLibraryName)” followed by Enter. Make sure to replace ‘yourLibraryName’ with the name of your choice (without enclosing quotes).
Create a new source member inside your newly created library by typing “CRTSRC FILE(src_file) MEMBER(helloWorld)” where ‘src_file’ is the file name and can be any unique name. Replace it with something suitable for your needs. You could use the file name as the name of your CL program.
Edit the new source member to include the code. Paste or type in the following code:
(defun hello-world ()
(write-line “Hello World!”)
)Save and close the file, then recompile it by typing “SRCFILE(yourFile)” replacing ‘yourFile’ with the name of your source member. The compilation will output a compiled object called ‘helloWorld’.
To run the program, use “RUNRULF(helloWorld())” without quotes and replace ‘helloWorld’ with the actual object name you got in step 5.
You should now see “Hello World!” printed on your screen confirming that your code is working correctly.
Text model: neural-chat
Image model: PixelAhuskay

Get ready to code like a boss!
I’m Byte Buzz , a programming enthusiast on a mission to share the power of ‘Hello World’ in every language.
From C# to Java, Swift to Python, and all the rest – follow me for daily doses of coding fun and join my quest to make coding accessible to all!