COBOL for AIX

COBOL for AIX

Connect, learn, share, and engage with IBM Power.

 View Only

How to set the different COBOL for AIX filesystems?

By Archive User posted Thu September 08, 2016 11:30 AM

  

Originally posted by: BasilTK


There are three ways for a user to set the filsystem when using COBOL for AIX:

 

1) export COBRTOPT="fs=<filesys>" . This is a global setting and will be applied to all your files and programs. 
eg
export COBRTOPT="fs=stl"

 

or

2) Filenames in environment variables, such as: export INFILE="<filesys>-<filename>" - it specifies which file system to use, and provides the filename for that specific file only.
eg:
export INFILE="stl-/home/username/inputfilename"     or
export OUTFILE="stl-/home/username/outputfilename" 
 
     Please note if you use export INFILE="<filename>" - which does not specify a file system, it means that you are actually using whatever was established via export COBRTOPT="fs=<filesys>" (see number 1 above). 
 

or
3) ASSIGN statements in the COBOL source. One can provide a hard coded filename, or filesystem-filename in the program (which is fairly rare).   Again, if there is no filesystem specified, then it means that you COBOL environment defaults to COBRTOPT="fs=<filesys>"

eg:

    file-control.
           select outfile assign to "STL-outfile.txt"
           organization is sequential.

0 comments
2 views

Permalink