What Is COB2SAS?
COB2SAS is a free sample program that can assist you with converting COBOL data description entries (also known as FDs, copybooks, or copylibs) into equivalent SAS® language INPUT and LABEL statements. COB2SAS reads, as its input, your COBOL program (or copybook). It parses the COBOL program, searching for FILE DESCRIPTOR sections. When COB2SAS finds a FILE DESCRIPTOR section, it parses this section to produce an equivalent SAS INPUT statement. A SAS LABEL statement is also produced to associate the SAS variable names with the COBOL data names. These INPUT and LABEL statements then can be used in a SAS program to read the file in which the FILE DESCRIPTOR section was pointing. A SAS data library is also produced that contains all of the information gathered about the copybook.
COB2SAS is written in the SAS language and executes on MVS, CMS, UNIX, and Windows platforms.
The SAS variable names that are produced will be up to 30 characters long. By default, the SAS INPUT and LABEL statements are written to an external file that is referred to by the OUTSAS fileref. By default, the information gathered by COB2SAS is written to a permanent SAS data library that is referenced by the PERM libref.
How to Download COB2SAS
- Click cob2sas8.zip and download the cob2sas8.zip file to your machine.
- Create a temporary directory. Unzip the cob2sas8.zip file using WinZip (or some other ZIP software) and extract the contents to this temporary directory.
- Read the readme.txt file. The readme.txt file contains information about this modified version of COB2SAS. It also contains the rest of the installation process.
The following documentation is included with the COB2SAS download:
• R2USGD.TXT and R2USGD.HTM: COB2SAS Usage Guide
The text file contains the original usage guide. The HTM file contains the same information with additional updates. It is also easier to read.
• R2RFRN.TXT and R2RFRN.HTM: COB2SAS Reference Guide
The text file contains the original COB2SAS Reference Guide. The HTM file contains the same information with additional updates. It is also easier to read.
• R2RNTS.TXT: Release Notes for COB2SAS, Release 2
Note: Release 2 came out in 1990. The modifications in this download are not a new release.
• DSCLMR.TXT: SAS disclaimer statement
• COPYRIT.TXT: Copyright information
• TDMK.TXT: Trademark information
• R2NSTL.TXT: OLD COB2SAS Installation Instructions
When COB2SAS was distributed on tape media, you used these instructions. Because you downloaded COB2SAS from the web, you will *not* use these! The only reason these instructions are included is because they contain some information that might be useful. The instructions for installing COB2SAS on your desired platform are included in the host-specific README files.
• FAQ.TXT and FAQ.HTM: COB2SAS FAQ
Frequently asked questions about COB2SAS.
• RDMEMVS.TXT: Host-specific README file for z/OS
The installation instructions for z/OS are enclosed in this file.
• RDMECMS.TXT: Host-specific README file for CMS
The installation instructions for CMS are enclosed in this file.
• RDMEUNX.TXT: Host-specific README file for UNIX
The installation instructions for UNIX are enclosed in this file.
• RDMEWIN.TXT: Host-specific README file for Windows
The installation instructions for Windows are enclosed in this file.
Conclusion
COB2SAS is a tool that that can be used to assist in converting COBOL copybook to SAS INPUT statements. There are some things that COB2SAS cannot fully handle and requires additional work so SAS can properly load the data files created by your COBOL program. Refer to the FAQ document for information about some of the common problems.