Comp-3 conversion problem
Moderators: chulett, rschirm, roy
Comp-3 conversion problem
Hi,
I want to convert a pic s9(9)v99 Comp-3 field
I am FTP ing the file from mainframes.
I searched the forum for any possible ideas but didn't help me much.
Can anyone throw some light on this conversion issue.
Thanx
I want to convert a pic s9(9)v99 Comp-3 field
I am FTP ing the file from mainframes.
I searched the forum for any possible ideas but didn't help me much.
Can anyone throw some light on this conversion issue.
Thanx
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
ftp the file in binary mode to create a sequential file on your DataStage server, then use the CFF (complex flat file) stage to read the file.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
A quick check, ftp the file back to the mainframe as see whether you still have the 'original data' in the file.
I stopped doing EBCDIC conversions in DataStage a long time ago. My experience is that unpacking/conversion/stripping of high- and low characters is much easier to code on the mainframe.
Ogmios
I stopped doing EBCDIC conversions in DataStage a long time ago. My experience is that unpacking/conversion/stripping of high- and low characters is much easier to code on the mainframe.
Ogmios
In theory there's no difference between theory and practice. In practice there is.
-
- Participant
- Posts: 145
- Joined: Fri May 02, 2003 9:59 am
- Location: Seattle, Washington. USA
Are you really stuck on using the FTP stage? If not I would just set a script up to binary ftp the files to the DataStage server then use the complex flat file stage to convert the data. We are doing this for files that we get from the AS/400 and it works great and it sure beats having to do all the conversions in the transformer.pkl wrote:Hi Craig,
While doing the ftp I specified it to be in binary representation. I thought that should be enough. Is there anythign else I need to check for?
Thanks
Shawn Ramsey
"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
I don't see anywhere that the OP mentioned the FTP stage.
As noted, the best answer is to do a binary FTP and then let the CFF stage do all of the dirty work. If you don't have it installed, why not take the time to do so? Rerun the server install and it should let you simply install any optional plugins you missed the first time.
![Confused :?](./images/smilies/icon_confused.gif)
As noted, the best answer is to do a binary FTP and then let the CFF stage do all of the dirty work. If you don't have it installed, why not take the time to do so? Rerun the server install and it should let you simply install any optional plugins you missed the first time.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
PKL,
If you are trying to convert the file from the mainframe "by hand" you've probably run into a very nasty problem, because I did several times before the CFF stage was available from Ascential.
If you have several packed fields (COMP-3, COMP, etc) mingled with non-packed fields (PIC X, PIC 9, etc) in your data, you're doomed to fail if you don't understand HOW the data is packed. Packed means packed. A 12 digit numeric field that is packed does not take up 12 bytes. It may take up 6 or 7 depending on HOW it is packed.
If you mess up this calculation of offset, EVERY OTHER OFFSET OF FIELDS IN THE ROW IS MESSED UP, and you'll never convert the data correctly.
Unless you're intimately familiar with EBCDIC and packed data and packing algorithms, use the CFF stage.
Otherwise, buckle up and get ready to spend a lot of time getting lost in the data. While you're at it, dust off you're resume.![Smile :)](./images/smilies/icon_smile.gif)
If you are trying to convert the file from the mainframe "by hand" you've probably run into a very nasty problem, because I did several times before the CFF stage was available from Ascential.
If you have several packed fields (COMP-3, COMP, etc) mingled with non-packed fields (PIC X, PIC 9, etc) in your data, you're doomed to fail if you don't understand HOW the data is packed. Packed means packed. A 12 digit numeric field that is packed does not take up 12 bytes. It may take up 6 or 7 depending on HOW it is packed.
If you mess up this calculation of offset, EVERY OTHER OFFSET OF FIELDS IN THE ROW IS MESSED UP, and you'll never convert the data correctly.
Unless you're intimately familiar with EBCDIC and packed data and packing algorithms, use the CFF stage.
Otherwise, buckle up and get ready to spend a lot of time getting lost in the data. While you're at it, dust off you're resume.
![Smile :)](./images/smilies/icon_smile.gif)
-
- Participant
- Posts: 145
- Joined: Fri May 02, 2003 9:59 am
- Location: Seattle, Washington. USA