|
COB2SAS is a tool that can be used to convert a COBOL FILE DESCRIPTOR SECTION into a SAS INPUT and LABEL statement. It reads as it's input your COBOL COPYBOOK. It produces a SAS INPUT statement and a SAS LABEL statement. The LABEL statement associates the 32 character data names with the 8 character SAS variable names. It also produces a SAS data library that contains all of the information that it gathered about the copybook.
The most current release is Release 2, which was made available in July of 1990; however, there has been one fix to COB2SAS since then. The fix is in the R2COB2 file. The new R2COB2 file is incorporated into the zipped COB2SAS downloadable file on the SAS ftp site and on the SAS Web site. If you want only the changed R2COB2 member, then you can download it from ftp://ftp.sas.com/techsup/download/mvs/cob2sas/. For more information about Release 2 of COB2SAS see the Release Notes. There is also a V8 modified version of COB2SAS that adds support for long variable names and other enhancements.
It's available in downloadable form on the SAS web site. In order to install it, you will need installation instructions. These can be obtained in Technical Support Document TS-536. This document contains links to the download locations. If you don't have the capability to download files from the web, you can have a copy mailed to you by contacting the SAS Technical Support Department at 919-677-8008.
Yes! The documentation is online. COB2SAS comes with a number of files. Five of the files contain documentation. The following are a list of the files and the documentation they contain:
COB2SAS is designed to work on MVS, CMS, VMS, and VSE. Since COB2SAS is just a big data step, it will physically execute on any platform that SAS runs on with minor modifications to the COB2SAS code. The problem is that it is very likely that either COB2SAS will not be able to parse the copybook or that the INPUT statement COB2SAS generates will not work on other platforms because of differences in the way that packed fields are stored. In order for COB2SAS to work on another platform, a few things must
be true. First the COBOL syntax of the copybook your trying to
convert has to conform to ANSI specification X3.23-1985. Second, the
various pictures clauses and usages must translate to the SAS
informats in the way that is described in SAS Note If these two things are true, then it should work; however, you must keep in mind that Technical Support will only address issues on the MVS, CMS, VMS, and VSE platforms. The V8 modified version of COB2SAS already has the required code changes to run COB2SAS on PC and Unix platforms.
If your OUTSAS DD is not being allocated DISP=MOD, you will see this behavior. You will also see this behavior when the OUTSAS DD points to a PDS member. Partition Data Sets to not support DISP=MOD. The reason the OUTSAS has to be allocated DISP=MOD is because the INPUT statement is written to the OUTSAS DD in one data step (contained in the R2COB6 member). The LABEL statement is then written in another data step (contained in the R2COB7 member). When the OUTSAS DD is allocated DISP=OLD, the data step which writes the LABEL statement overwrites the contents of OUTSAS, and you only get the LABEL statement. When OUTSAS is allocated DISP=MOD, the LABEL statement is appended after the INPUT statement. The V8 modified version of COB2SAS has corrected this problem by writing both the INPUT and LABEL statements in 1 data step.
By default COB2SAS doesn't expand OCCURS clauses. If you want COB2SAS to expand OCCURS clauses, you must edit your R2MVS, R2CMS, R2VMS, or R2VSE member (depending on which operating system you are using). Locate the line of code that includes the R2COB5 program. By default this line is commented out. Uncomment the line, save the program, and COB2SAS will expand your OCCURS clauses. Note that COB2SAS will not expand nested OCCURS clauses. COB2SAS will also assume the upper bound when it encounters an OCCURS DEPENDING ON clause. In the V8 modified version of COB2SAS, the default is to expand OCCURS clauses
This could be happening for any of the following reasons:
First you must edit your R2MVS, R2CMS, R2VMS, or R2VSE member (depending on which operating system that you are on). Locate the commented line of code that says: %LET FILE = FILE OUTSAS; Uncomment this line. You then must allocate a fileref called OUTSAS. If you are on MVS, make sure that you allocate it with DISP=MOD! The method for doing this is documented in the 'Redirecting Output under XXX' (where XXX is your operating system). For further information, refer to that document. This change is already made in the V8 modified version of COB2SAS.
ERROR: The POINT= data set option is not valid for the data set WORK.DICTNRY, the data set must be accessible by observation number for POINT= processing. You're getting this error because you have the COMPRESS=YES system option set. COB2SAS uses the SET statement with the POINT= option. You can not use POINT= on a compressed data set. To circumvent specify COMPRESS=NO.
COB2SAS sorts the variables by the ATBYTE position. If this is not the desired behavior, then you can comment out the PROC SORT statement at the bottom of your R2COB5 program. Deleting this PROC SORT will cause the order to match that of the copybook.
Fillers are just that - fillers. Your COBOL program isn't using them, so COB2SAS ignores them. SAS doesn't have the group variable construct so COB2SAS ignores them too. |