The date format in your File-1 is CCYYMMDD which in packed decimal would require 5 bytes. But your copybook shows only 5 numeric digits which requires only 3 bytes which agrees with your "File Master". Can you post a few sample records from your actual files.
I m not saying that your production file is wrong. The way you interpret might be wrong. A packed decimal field will always store the sign in the last half-byte. And your 3 byte packed date looks like this which is not a valid COMP-3 field. You need to be clear on what data are you processing with.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Open your file in view/browse (not file master) and scroll right to this data position (also use COLS to show the positions in the record). Post this bit of data in hex (HEX ON, copy/paste to the reply you will be creating, and use the "Code" tag to make the data more readable as well as preserve alignment) - including the COL info. Use the Preview to see your reply as it will appear to the forum and when you are satisfied with how your post appears, Submit.
As has been mentioned, the data posted is not valid packed-decimal (comp-3) data.
The following is similar to how your data should be posted. The 2 numbers are valid comp-3 values for 08215 and 21508. I used a C sign, but an F sign could be valid as well.
It sounds like the displacement used in the sort control is not where the packed-decimal data is located.
Joined: 22 Apr 2006 Posts: 6258 Location: Mumbai, India
Hopefully you are available with the manuals, if not request Alissa to send the latest documentation to you, she is SyncSort representative & Moderator of JCL part on this site.
1. OPTION COPY: Causes XXxxSORT to copy a SORTIN data set or inserted records to the output data sets. ( unless all records are disposed of by an E35 exit).
2. IFTHEN clauses: Reformat different records in different ways by specifying how build or overlay items are applied to records that meet given criteria. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted.
2. BUILD: Reformat each record by specifying all of its items one by one. Build gives you complete control over the items you want in your reformatted records and the order in which they appear. You can delete, rearrange and insert fields and constants.
3. OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Overlay lets you change specific existing columns without affecting the entire record.
OVERLAY is used to overlay specific bytes - you can't use it to insert characters before other fields. For that you must use BUILD which builds the record item by item.
4. If you have multiple fields to inspect in the same record, you must use the HIT=NEXT option.