I have no experience with COBOL but one of the programs that I need to read in the mainframe with SAS is written in COBOL and I see fields like the following:
Amount 0000000084{ 0000000433F
how can I read this data using SAS commands?
Thanks
I have no experience with it, but PROC COPYLIB is a SAS procedure that will read any valid COBOL record layout and produce the following:
1) Generate an equivalent input statement for the processed COBOL record layout.
2) A SAS dataset containing a description of the COBOL record layout. This data set can be used as a data dictionary.
3) COBOL Record Layout Report -- which details the COBOL record layout including the starting position, length, and type for each field within the FD.
4) COBOL/SAS Conversion Report -- which matches the COBOL FD to the generated SAS input statement.
Your SAS format for these two fields would beL
This will define "firstNum" and "secondNum" as the zoned data in the line below:
I'm assuming the "Amount" started at position one, otherwise you would need to adjust your positioning.