> this could be a more useful version: Massimo,
Peter mentioned that the input has a 2-byte zoned decimal "data length" value which identifies the number of SIGNIFICANT columns. So the maximum value that a 2 byte zoned decimal can hold is 99. Your job fails as the arithmetic ends with a negative number Try this sample data H 99 D AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA D BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB D CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC It is an easy fix, however note that your solution might not scalable for an bigger LRECL's as you are simply generating the IFTHEN statements for every unique length. Imagine if you have unique lengths from 1 - 32760 ( OP has only 2 bytes of zoned decimal but what if it was unsigned binary field? There is a trick to get this done without generating IFTHEN statements. Kolusu ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
