05-30-2014 10:26 AM
(1) I have a column of data that looks has either a positive amount or a negative number. The data is suppose to be formatted 12.2
Fred's amount = 23,000.86 and
Barney's amount = -99999999.99
The Variable Name that I am having trouble with is: TotalRewardCash shown below.
(2) A second question I have is the Variable PeriodId is yyyymmdd and I would like to read it in as a date, but couldn't find an ebcdic format that would work properly.
@1 ReferenceNumber $EBCDIC12.
@13 CustomerID $EBCDIC12.
@25 BankId $EBCDIC12.
@37 PeriodId $EBCDIC8.
@135 TotalRewardCash S370FZDU12.2 ;
I have tried many informats but this one gets me the closest. It brings in the numbers but will not bring in the leading negative sign.
I have tried S370FZDL12.2 but then I get nothing.
Does anyone have any suggestions?
05-30-2014 11:02 AM
When you are running this code in a mainframe you do not the $EBCDIC coding the $ coding will do as Ebcdic is default in z/OS.
When you have downloaded the file binary, beware of record formats. Sometimes you get trapped by cr/lf characters as part of numeric values.
There are several dedicated numeric formats at z/OS.
- floating often not used with Cobol.
- packed (with signs) the two digits are getting compressed by their hexadecimal representation
- Zoned (with signs) the digits are not compressed but the last digit is with the sign.
- character based. Similar to zoned but not having signs. It is more a constraint on some values on the used chars.
You have used the unsigned zoned type. No wonder you no signs
SAS(R) 9.4 Formats and Informats: Reference S370FZDw.d Informat is most common. Watch the notes on the used Cobol Picture. When you know that one you are sure wich format to be used.
05-30-2014 11:18 AM
I am not using Mainframe SAS to read the file. I use Enterprise Guide interface and read the Mainframe file via FTP statement. That is why I need to use the EBCDIC informats to read my data in. Otherwise I get gibberish.
I have tried all of the file formats listed and none of them get me the desired results.
I will review the website to see if I missed any. Thanks anyway..
Need further help from the community? Please ask a new question.