R2CMS ........ Invokes COB2SAS on CMS.
R2MVS ........ Invokes COB2SAS on MVS.
R2VMS ........ Invokes COB2SAS on VMS(TM).
R2VSE ........ Invokes COB2SAS on VSE.
R2COB1 ........ Creates formats used for parsing.
R2COB2 ........
R2COB3 ........ Updates the data dictionary with the nformation in the group data set.
R2COB4 ........ Compresses COBOL data names to no ore than 8 characters.
NOTE: R2COB4 was modified to handle 32 character variable names
R2COB5 ........ Expands OCCURS variables.
R2COB6 ........ Uses the information in the data dictionary to produce SAS(R) language input statements.
R2COB7 ........ Uses the information in the data dictionary to produce SAS language label statements.
NOTE: R2COB6 and R2COB7 were combined into 1 program which now resides in R2COB6.
R2NSTL ........ COB2SAS, Release 2 Installation Guide
NOTE: The Installation Guide has been supplemented with TS-536:Installing COB2SAS from the WWW.
R2RFRN ........ COB2SAS, Release 2 Reference
R2RNTS ........ COB2SAS, Release 2 Release Notes
R2USGD ........ COB2SAS, Release 2 Usage Guide
COPYRIT ........ COPYRIGHT Notice
DSCLMR ........ DISCLAIMER
TDMK ........ TRADEMARK Notice
CP1 ........ COBOL Program 1
CP1LOG ........ Log of an execution on COBOL Program 1.
CP1LST ........ Listing of an execution on COBOL Program 1.
VMS is a trademark of Digital Equipment Corporation.
COB2SAS, Release 2 is a tool that can assist you in converting COBOL language data description entries into equivalent SAS language statements.
COB2SAS, Release 2 uses the information in the data description entries of COBOL language programs to create a data dictionary. Succeeding steps use this data dictionary to create SAS language statements equivalent to the data descriptions entries.
Included in COB2SAS, Release 2 are 4 programs, one for each operating system for which COB2SAS is distributed, that invoke COB2SAS. These 4 programs differ in the conventions used to invoke R2COB1 through R2COB7 and in the conventions used to reference files.
Any special requirements for the INFILE and FILE statements are provided in these programs. Also, in these programs, you can provide statements that will direct the data dictionary to a permanent SAS data set and the SAS language statements to a flat file.
INFILE & FILE statements
Conventions for including code for execution
The programs that convert COBOL language data description entries into SAS language statements are stored in 7 files.
R2COB1 uses PROC FORMAT to create formats that are used while parsing COBOL language data description entries.
R2COB2 uses a data step to parse the data description entries and produce 2 SAS data sets. The first data set contains an observation for each data description entry. The second data set has information about the lengths of groups of data items.
R2COB3 uses PROC SORT and a data step to combine the group data set and the data dictionary data set.
R2COB4 uses PROC SORT and the data step to compress the lengths of variable names to no more than 8 characters. (note: This has been disabled because of added support for long variable names in SAS)
R2COB5 is an optional step that uses the data step and PROC SORT to expand 1 dimensional tables. It is designed to:
By default, the statement that includes R2COB5 is commented out. If you want to use R2COB5, you will need to acquire a copy of the program that invokes COB2SAS on your operating system (for example, R2MVS on MVS) and uncomment the line that includes R2COB5 for execution.
R2COB6 uses the data step to produce SAS INPUT statements.
R2COB7 uses the data step to produce SAS LABEL statements.
NOTE: R2COB6 and R2COB7 were combined into one program to avoid the need for allocated the OUTSAS file with a disposition of MOD
Regardless of the operating system, the contents of R2COB1 through R2COB7 are identical.
If you are not getting proper output, or any output at all, the first thing to look at is your source program. In order for COB2SAS to work, the file that it is reading should be in a form that the COBOL compiler can use. COB2SAS does no checking for syntax errors in the COBOL language statements. Furthermore, COB2SAS makes the following assumptions about the data description entries that it will read.
Assumptions regarding the location of entries within margins
IDENTIFICATION DIVISION
ENVIRONMENT DIVISION
DATA DIVISION
PROCEDURE DIVISION
FILE SECTION
01
FD
SD
CD
RD
If the COBOL language statements that COB2SAS is reading are in a form that the COBOL compiler can use and you are not getting output from COB2SAS, there are a couple of things that you can do to find out what may be wrong. Within the member that invokes COB2SAS on your system (for example, R2MVS on MVS), you will find the SWITCHES data set. The SWITCHES data set allows you to put various options in effect when COB2SAS is processing.
For purposes of determining why COB2SAS is not producing output, use the TRACEPRS option. The TRACEPRS option determines the type of tracing information produced while parsing. For more details on this option, as well as further discussion of other available options, please refer to the COB2SAS, Release 2 Reference manual.
This version of COB2SAS is dated 22Jul90 and is Release 2. As of the date of this release, there are no plans to produce a third release. The purpose of a third release would be to correct any flaws in Release 2 and to provide enhancements that will make COB2SAS a more useful tool.
Although there are no plans to produce a third release, that plan is subject to change depending on response from those who use COB2SAS. Please use the following procedure to document flaws that you have uncovered in COB2SAS, Release 2 or any requests for enhancements.
Acquire the COBOL entry and either the equivalent SAS statement that should be produced or a suggestion of how COB2SAS should handle the entry. Please contact SAS Technical Support at 919-677-8008, or send E-mail to support@sas.com.
To use COB2SAS, associate the fileref INCOBOL with the flat file that has your COBOL record descriptions and include R2CMS for execution by the SAS System. By default, the data dictionary is temporarily stored in the WORK library and the SAS language statements produced by COB2SAS are written to the SAS Log.
Included with COB2SAS, Release 2 are files, CP1 COBOL, whichhas COBOL language data description entries and, CP1LOG LOG and CP1LST LISTING, which have the output produced by executing the sample program shown below. You may want to use these files to get an idea of how COB2SAS works. If you choose to do so, submit the sample program shown below.
NOTE: There is no need for you to type in a copy of this program yourself. Since a copy of this guide is in the file R2USGD, you can get a copy of this program from R2USGD.
The SAS System must be invoked with the SAS System option MACRO in order for COB2SAS, Release 2 to work properly.
OPTIONS NONOTES NOSOURCE NOSOURCE2;
FILENAME INCOBOL 'CP1 COBOL fm';
RUN;
%INCLUDE COB2SAS(R2CMS);
RUN;
PROC PRINT DATA=DICTNRY;
FORMAT RDF_NAME $8.;
BY FILENAME NOTSORTED;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
where fm is the filemode of the minidisk with the test data set Compare the SAS Log and Listing files with the results provided in data sets:
CP1LOG LOG fm
CP1LST LISTING fm
where fm is the filemode of the minidisk on which they reside.
Since the listing produced by the sample program is created by PROC PRINT, it is possible that the format of your listing and the listing in CP1LST will be slightly different. If output is produced and the values in that output match those in CP1LST, then the sample program has executed successfully.
After establishing that COB2SAS is running properly there are a couple of things that you will probably want to do. First, you will probably want to save, in a flat file, the SAS language statements generated by COB2SAS. Second, you may wish to save your data dictionary in a permanent SAS data set. To do this, you will need to get a copy of R2CMS from the COB2SAS MACLIB. You can get a copy of R2CMS by issuing the appropriate filedef's and using the CMS MOVEFILE command. For example:
FILEDEF INMOVE DISK COB2SAS MACLIB fm (MEMBER R2CMS
FILEDEF OUTMOVE DISK R2CMS SAS fm
MOVEFILE
Once you have a copy of R2CMS, locate the following lines in it:
* %LET FILE = FILE OUTSAS;
* %LET LIBREF = PERM.;
(NOTE: The libref must end with a period as shown.)
Remove the leading *'s from these lines so that they will not be treated as comments. You will then need to add filedef's to your sample program. You need one to associate the fileref OUTSAS with a flat file and one to associate the libref PERM to a permanent SAS data set. What you end up with should be similar to this:
OPTIONS NONOTES NOSOURCE NOSOURCE2;
FILENAME INCOBOL 'CP1 COBOL fm';
FILENAME OUTSAS 'OUTSAS SAS fm';
LIBNAME PERM 'fm';
RUN;
%INCLUDE R2CMS;
RUN;
PROC PRINT DATA=PERM.DICTNRY;
BY FILENAME NOTSORTED;
FORMAT RDF_NAME $8.;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
After submitting this job, the SAS language statements, produced by COB2SAS, will be in the file, OUTSAS SAS, and the data dictionary will be in the file, DICTNRY PERM.
If you want to inspect the COB2SAS MACLIB, you can, if you wish, use the MACLIST command. MACLIST (which is a CMS command) is a convenient facility for inspecting MACLIB's.
If you encounter difficulties with this job, you may need to insure that there are no files with filename, COB2SAS, on or ahead of the minidisk on which the COB2SAS MACLIB resides.
Finally, be sure that there are no filedef's in effect for the COB2SAS MACLIB. For example, if you used the MOVEFILE command to acquire a copy of member R2CMS, then be sure to clear the filedef for INMOVE.
To use COB2SAS, associate the fileref INCOBOL with the flat file that has your COBOL record descriptions and include R2MVS for execution by the SAS System. By default, the data dictionary is temporarily stored in the WORK library and the SAS language statements produced by COB2SAS are written to the SAS Log.
Included with COB2SAS, Release 2 are members of the COB2SAS PDS, CP1, which has COBOL language data description entries and, CP1LOG and CP1LST, which have the output produced by executing the sample program shown below. You may want to use these files to get an idea of how COB2SAS works. If you choose to do so, submit the sample program shown below.
NOTE: There is no need for you to type in a copy of this program yourself. Since a copy of this guide is in the file R2USGD, you can get a copy of this program from R2USGD.
The SAS System must be invoked with the SAS System option MACRO in order for COB2SAS, Release 2 to work properly.
Any lines that you must edit are denoted by, //TESTC2S JOB acct-info <== VERIFY
// EXEC sas,OPTIONS='MACRO' <== VERIFY
//COB2SAS DD DISP=SHR,DSN=prefix.cob2sas.programs <== VERIFY
//INCOBOL DD DISP=SHR,DSN=prefix.cob2sas.programs(CP1) <== VERIFY
//SYSIN DD *
OPTIONS NONOTES NOSOURCE NOSOURCE2;
%INCLUDE COB2SAS(R2MVS);
RUN;
PROC PRINT DATA=DICTNRY;
FORMAT RDF_NAME $8.;
BY FILENAME NOTSORTED;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
/*
'<==VERIFY'.
Compare the SAS Log and Listing files with the results provided in the CP1LOG and CP1LST members of the COB2SAS PDS.
Since the listing produced by the sample program is created by PROC PRINT, it is possible that the format of your listing and the listing in CP1LST will be slightly different. If output is produced and the values in that output match those in CP1LST, then the sample program has executed successfully.
If you want to execute COB2SAS interactively use the included DMSMVS program.
After establishing that COB2SAS is running properly there are a couple of things that you will probably want to do. First, you will probably want to save, in a flat file, the SAS language statements generated by COB2SAS. Second, you may wish to save your data dictionary in a permanent SAS data set. To do this, you will need to acquire a copy of R2MVS from the COB2SAS PDS. Once you have a copy of R2MVS, locate the following lines in it:
* %LET FILE = FILE OUTSAS;
* %LET LIBREF = PERM.;
(NOTE: The libref must end with a period as shown.)
Remove the leading *'s from these lines so that they will not be treated as comments. You will then need to add DD statements to your sample program. You need one to associate the fileref OUTSAS with a flat file and one to associate the libref PERM to a permanent SAS data set. What you end up with should be similar to this:
//TESTC2S JOB acct-info
// EXEC sas,OPTIONS='MACRO'
//COB2SAS DD DISP=SHR,DSN=prefix.cob2sas.programs <==VERIFY
//R2MVS DD DISP=SHR,DSN=prefix.your.r2mvs <==VERIFY
//INCOBOL DD DISP=SHR,DSN=prefix.cob2sas.programs(CP1) <==VERIFY
//OUTSAS DD DISP=OLD,DSN=prefix.flat.file <==VERIFY
//PERM DD DISP=OLD,DSN=prefix.your.sasds <==VERIFY
//SYSIN DD *
OPTIONS NONOTES NOSOURCE NOSOURCE2;
%INCLUDE R2MVS;
RUN;
PROC PRINT DATA=PERM.DICTNRY;
FORMAT RDF_NAME $8.;
BY FILENAME NOTSORTED;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
/*
After submitting this job, the SAS language statements, produced by COB2SAS, will be in the file, OUTSAS, and the data dictionary will be in the file, PERM.
To use COB2SAS, associate the fileref INCOBOL with the flat file that has your COBOL record descriptions and include R2VMS for execution by the SAS System. By default, the data dictionary is temporarily stored in the WORK library and the SAS language statements produced by COB2SAS are written to the SAS Log.
Included with COB2SAS, Release 2 are files, CP1.DAT, which has COBOL language data description entries and, CP1LOG.DAT and CP1LST.DAT, which have the output produced by executing the sample program shown below. You may want to use these files to get an idea of how COB2SAS works. If you choose to do so, submit the sample program shown below.
NOTE: There is no need for you to type in a copy of this program yourself. Since a copy of this guide is in the file R2USGD, you can get a copy of this program from R2USGD.
Version 6 of the SAS System must be invoked with the SAS System option, MACRO, in order for COB2SAS, Release 2 to work properly.
OPTIONS NONOTES NOSOURCE NOSOURCE2;
FILENAME INCOBOL 'SAS$ROOT:<SAMPLES.BASE.COB2SAS>CP1.DAT';
RUN;
%INCLUDE 'SAS$ROOT:<SAMPLES.BASE.COB2SAS>R2VMS.SAS';
RUN;
PROC PRINT DATA=DICTNRY;
BY FILENAME NOTSORTED;
FORMAT RDF_NAME $8.;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
Compare the SAS Log and Listing files with the results provided in the CP1LOG.DAT and CP1LST.DAT data sets. Since the listing produced by the sample program is created by PROC PRINT, it is possible that the format of your listing and the listing in CP1LST will be slightly different. If output is produced and the values in that output match those in CP1LST, then the sample program has executed successfully.
After establishing that COB2SAS is running properly there are a couple of things that you will probably want to do. First, you will probably want to save, in a flat file, the SAS language statements generated by COB2SAS. Second, you may wish to save your data dictionary in a permanent SAS data set. To do this, you will need to get a copy of R2VMS from the COB2SAS directory. Once you have a copy of R2VMS, locate the following lines in it:
* %LET FILE = FILE OUTSAS;
* %LET LIBREF = PERM.;
(NOTE: The libref must end with a period as shown.)
Remove the leading *'s from these lines so that they will not be treated as comments. You will then need to add FILENAME and LIBNAME statements to your sample program. You need a FILENAME statement to associate the fileref OUTSAS with a flat file. You need a LIBNAME statement to associate the libref PERM to a permanent SAS data set. What you end up with should be similar to this:
OPTIONS NONOTES NOSOURCE NOSOURCE2;
FILENAME INCOBOL 'SAS$ROOT:<SAMPLES.BASE.COB2SAS>CP1.DAT';
FILENAME OUTSAS 'OUTSAS.DAT';
LIBNAME PERM '<>';
RUN;
%INCLUDE 'R2VMS.SAS';
RUN;
PROC PRINT DATA=PERM.DICTNRY;
BY FILENAME NOTSORTED;
FORMAT RDF_NAME $8.;
ID LEVEL;
VAR NST_DPTH NEWNAME USAGE PICTURE INFMT ATBYTE BYTES
OCR_VAL RDF_NAME;
RUN;
where <> refers to the default directory.
After submitting this job, the SAS language statements, produced by COB2SAS, will be in the file, OUTSAS.DAT. When run under Version 5 of the SAS System, the data dictionary will be in the file, DICTNRY.SSD. When run under Version 6 of the SAS System, the data dictionary will be in the file, DICTNRY.SASEB$DATA.
The use of COB2SAS with the VSE operating system is documented in Technical Support Document TS-528 How to run COB2SAS in the VSE Environment.