Page 1 of 1

Conversion from Binary to ZD

PostPosted: Fri May 14, 2010 7:04 pm
by mainframe_novice
I have a following file with Structure
SalesMan_Id CHAR(5)
SEQ_NUM ZD (3)
Sales_Amount Decimal(9,2)
SalesMan_ID SEQ_NUM  Sales_Amount
A0001              1                  237890.80
A0001              2                 4545365.80
A0002              1                   98563.75
A0002              2                   58663.75
A0002              3                   28563.75
A0002              4                  198563.75


I need to load this data to Sales Table which has structure
SalesMan_Id CHAR(5)
SEQ_NUM Integer(4)
Sales_Amount Decimal(9,2)

In order to get the seq_num I unload SalesMan_ID and Max Seq_num for that SalesMan
SalesMan_ID Max_Seq_Num
A0001               5
A0002               8


But this Max Seq Num is unloaded in Binary Format

Before Load I need to join this unloaded data with SalesFile shown above and add Max Seq Num to Seq Num to
SalesMan_ID SEQ_NUM  Sales_Amount
A0001              6                 237890.80
A0001              7                4545365.80
A0002              9                  98563.75
A0002             10                  58663.75
A0002             11                  28563.75
A0002             12                 198563.75


How Can I convert Binary to ZD so that using ADD in Outrec I can add the SEQ_NUM .

Re: Conversion from Binary to ZD

PostPosted: Tue May 18, 2010 2:24 am
by Alissa Margulies
I'm not sure I follow your entire process, but if all you are asking is how to convert a BI field to ZD, then you can code the following INREC statement:
INREC FIELDS=(6,4,BI,ZD)

Just be aware that your output field is now going to be 8 bytes long.

If this is not what you are looking for, then please provide us with sample input and output records with HEX turned on, so that we can better assist you.