![handling a cl data structure with signed fields in it](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0OUIEuaUlp8vxTSDPVd90Iszax8fotBKevZ835dYNEzJcIr7fvkYP4jC7q44p6VszCVDb-CrUONFlAROvHq6VTuW6ac-lFRILTkraz8HfxH4DlLeMwybUGb_Bmg9OP2GfrVdxz221kRiM/s200/cl.png)
The germ for this post comes from a question I was asked. The questioner was passing a file record as a data structure from a RPG program to a CL program, and when they looked at the data structure the CL program would "really mess up" some of the numeric data structure subfields. After further questioning I discovered the "messed up" fields we all signed numeric fields. Once I established that I knew what the problem was, and came up with a simple solution.
Let me show what the problem is, and then the solution I came up with. Let me start with the file, you will not be surprised to discover that I called it TESTFILE.