I'm looking for some advice/help on a file that I'm having some trouble with. The file originates from a mainframe, and is sent over to our iSeries (V5R2M0) via Connect:Direct. The file is 3680 Bytes long, comprising of string and compressed numeric data. I have the layout of the file, although it's in a notation I'm not familiar with, Cobol I think it is, which gives me the start and end position of all the fields, and what type they are.
My aim is to get this file from the 400 to a PC, with all the fields, in a CSV format, on a monthly basis as it's received. This solution is an interim one, probably lasting for a few months, no longer than a year.
What I've done is set up a physical file, defining all 300 or so fields in the file. I then copy the file received in the Connect:Direct library into my own file using the CPYF command with a *NOCHK option. This works fine, all the records are copied, but when I query the file 1 of the fields is unreadable and I get the message "Column B9012 contains replacement character +".
This field is defined in the layout file I have as:
211 09 PRRS-S1C-EDITION-NUMBER PIC S9(08) COMP.
This means that the field starts at position 211 in the file. The next field starts at position 215, so I've defined my field in the physical file as:
A B9012 7P 0 TEXT('S1C-EDITION-NUMBER')
All the other compressed numeric fields have the notation COMP-3., whereas this one is only COMP. - I'm not sure what the difference is there.
It would seem that the field is a compressed or packed numeric field, of 8, but for it to start at 211 and end at 215 I have to define it as 7 in the physical file. Do you have an idea of what I can do here?
At the moment, seeing this field is not essential, after the copy file command I'm just running through the file and setting the value to 0.
The next question I have is around Client Access. When I run Query, there are no errors shown in the file. However, when I try to use the "Receive File From Host" facility in Client Access, I get the error "CWBDB0052 - Error occurred during data conversion", but all records transfer successfully. I can't figure out which fields are in error, although from reading on the internet it would appear there may be null values that are causing this. I've switched off the option to display warnings during data transfer, which stops the message occurring. Would there be a problem I'm masking by doing this?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!