|
September 2002 Technical Tip – Format conversion with SyncSort I recently had a client ask me if it was possible to use SyncSort to convert a packed decimal field to its zoned decimal equivalent. Specifically, this client needed to convert a packed field in positions 8-10 to its zoned decimal equivalent, to be stored in the same positions. All other fields were to remain unchanged. The SyncSort solution follows:
| |
|
To convert numeric fields specify the first byte of the receiving field (8), a colon (:), the first byte of the sending field (8), the length of the sending field (3), the format of the sending field (PD), the format of the receiving field (ZD), and (optionally) the length of the receiving field (LENGTH=3). If the LENGTH parameter is omitted, the length of the receiving field will be determined based on the length and format of the sending field. For example, a 3 byte packed field can hold 5 digits. If the LENGTH parameter had been omitted, the new length would default to 5 bytes. Two more examples may help to explain:
As you can see, SyncSort does so much more than sort! Caliber Data Training is pleased to offer training in SyncSort as well as other utilities such as FileAid, Easytrieve, and SAS. We hope you will consider us when deciding upon a training provider. Go to the articles index. Written by Bill Qualls. Copyright © 2002 by Caliber Data Training 800.938.1222 |