Sample Source Code
Sample Source Code


Below are sample source code files.

Sample Description
accept.cblHow to get the system date and time, and how to capture standard input.
arithmetic.cblBasic arithmetic commands (ADD, SUBTRACT, MULTIPLY, DIVIDE.
banner.cblHow to display a Unix-style banner.
cal.cblHow to display a calendar for a given month and year.
call.cblHow to call an external application.
client.cblTCP/IP client example . use with SERV.CBL.
compute.cbl Different forms and uses of the COMPUTE statement, and the use of expressions.
convfuncs.cbl Metric system to English system and English to metric conversion functions.
copy.cbl How to include copybooks with the COPY command.
COPYBOOK.CPY Example COPYBOOK
COPYBOOK.INC Example COPYBOOK
count.cbl Return number of emails in an email account.
datafile.txt Data file for source code examples.
dep.cbl Generic depreciation example
display.cbl How to display different forms of output to the standard output device.
dns.cbl Domain Name Service query example.
down.cbl File download example.
down.zip Binary file for the File Download example source code to use.
dynfile.cbl Dynamic file creation example.
email.cbl Sent/Receive email examples.
eprb.cbl CGI example.
execute.cbl How to use the EXECUTE command to dynamically execute statements.
financefuncs.cbl Financial calculation and depreciation functions.
ftp.cbl File Transfer Protocol commands.
f_exec.cbl A file processing example that uses the EXECUTE command.
geomfuncs.cbl Trigonometric functions (sine, cosine, inverses, hyperbolics, etc).
getban.cbl How to save a Unix-style banner to a variable.
getcal.cbl How to save a calendar for a given month and year to a variable.
getcmdline.cbl Retrieve command line arguments.
getenv.cbl How to retrieve environmental variables from the operating system.
gethn.cbl Use of GETHOSTNAME command.
gettime.cbl Use of GETTIMEFROMSERVER command.
gm.cbl Get email example source code.
goback.cbl How to terminate a program using GOBACK.
hello.cbl Hello World example basic.
hello1.cbl Hellow World example #1
hello2.cbl Hello World example #2
hello3.cbl Hello World example #3
hmathfuncs.cbl Higher math functions (logs, natural logs, rounding, roots, etc).
if.cbl IF conditions.
init.cbl How to initialize variables.
input.cbl Input data file for RECCOPY.CBL sample program.
input.csv Data file for input.cbl source coce example.
IO.DAT Data file for source code example.
lower.cbl Lowercase example.
ltrim.cbl Left Trim example.
mail.cbl How to send simple emails, retrieve emails, and get count of emails on an SMTP server.
move.cbl Use of the MOVE statement.
occurs.cbl How to use the OCCURS clause.
openclse.cbl How to open and close files.
oper.cbl Examples of operator usage.
OUTPUT.DAT Output file from example source code program.
PAGE.CBL Simple CGI example.
perform.cbl Use of the PERFORM statement.
pic.cbl Picture clause example usage.
position.cbl How to use the POSITION statement to position to a particular record in a text data file.
prb.cbl Example CGI source code.
PRB.TXT Data file for CGI example prb.cbl
probfuncs.cbl Probability functions (random number generator, factorials, etc).
profoccr.cbl Professional Edition OCCURS clause example.
rb.cbl Reading Blocks of text.
read.cbl How to read data from files.
reccopy.cbl Read and Write file example.
replica.cbl How to use the REPLICA clause.
rewrite.cbl How to use the REWRITE statement to update records in a text data file.
rtrim.cbl Right Trim example.
serv.cbl TCP/IP server example . use with CLIENT.CBL.
set.cbl e of SET statement.
shm1.cbl Shared Memory programming example 1.
shm2.cbl Shared Memory programming example 2.
size.cbl Determine size in bytes of an email.
sm.cbl Send email example.
sprb.cbl CGI web example.
sql.cbl Professional Edition SQL example.
sql.cpy SQL return variable copybook.
stoprun.cbl How to terminate a program using STOP RUN.
tcpip.cpy TCP/IP return variable copybook.
test.dat Data file for example program.
timesht.txt Data file for uts.cbl CGI example program.
tok.cbl String tokenizing example.
trim.cbl String trim example.
upper.cbl Upper Case conversion example.
uts.cbl CGI example source code.
vprb.cbl CGI example source code.
web.cbl How to retrieve web pages and save them to a file.
web.txt Data file created by web.cbl source code example.
webban.cbl CGI example to display a banner in text.
write.cbl How to write data to a file.
WRITE1.DAT write.cbl data file.
write2.dat write.cbl data file.