View previous topic :: View next topic
|
Author |
Message |
crazyf1
New User
Joined: 05 May 2006 Posts: 26
|
|
|
|
Hi
Whenever we are trying to an FTP from Mainframe to a PC (Win2k/Win2k3). We are getting a wrong output for the hexadecimal part. Is there a parameter to be set so that we can get the correct output? We are suspecting that only codepage problem are the only cause. Any Idea??
Problem only occurs when the file is viewed in hexadecimal mode also.
Thanks
Regards, |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
The hex part you don't want tranlated? |
|
Back to top |
|
|
crazyf1
New User
Joined: 05 May 2006 Posts: 26
|
|
|
|
Yes. We want to retain the correct output for this.
Correct OUTPUT
FTP OUTPUT (Wrong)
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I'm thinking you're correct, sounds like a codepage problem. You have those symbols on the mainframe? You lose them on the PC? Have you found a codepage on the PC that does have them? |
|
Back to top |
|
|
crazyf1
New User
Joined: 05 May 2006 Posts: 26
|
|
|
|
Not yet. I am trying to see if this is really the problem or I am just missing some parameters. Anyidea on the codepage for this? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
No idea, if it's just a few symbols that don't translate, you could translate them to a value that will translate correctly prior to FTPing them. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
To do what you want sending packed/binary values, ftp the file in binary (not ascii). What is happening is that the translation to ascii is happening byte by byte and packed and binary numbers are translated along with the character data. Regardless of which code table you use, there is still the definition of which bytes to translate to ascii and which ones to leave as is.
When you transmit the file in binary you will then have to selectively translate the fields that are character fields.
You also have the consideration of how to deal with the packed values on the receiving side. Micro-Focus COBOL supports packed decimall on unix, but i've not yet used it in a Windows environment. I seem to recall that signed, packed numbers were a bit different on unix and we had to compensate for that.
After having done this a few thousand times at many sites, and using several approaches, i STRONGLY recommend creating files on the mainframe that have NO embedded packed or binary values. I'd also recommend some kind of delimited file for ease of use on the receiving end. PC-based databases, spreadsheets, etc respond well to delimited files. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
crazyf1
New User
Joined: 05 May 2006 Posts: 26
|
|
|
|
based on the COPY book where the part of the file is destroyed. I tried using a binary transfer but the output was all more different than using ASCII.
Thanks
Code: |
05 MES-CHIP-DATA.
10 MES-CHIP-DELIMITER PIC X(01) VALUE '{'.
10 MES-CHIP-EMBEDDED-LEN PIC 9(07) VALUE 43.
TOTAL LENGTH FROM THE NEXT
FIELD TO THE LAST CHIP DATA FIELD.
--------------------------------------------------------------------------------
10 MES-CHIP-PIX PIC X(04) VALUE X'10100000'.
10 MES-CHIP-TOTAL-LEN PIC X(02) VALUE X'0025'.
TOTAL LENGTH OF FIELDS FROM THE NEXT
FIELD TO THE LAST CHIP DATA FIELD.
10 MES-CHIP-KEK-ID PIC X(12) VALUE LOW-VALUES.
10 MES-CHIP-DATA-LEN PIC X(02) VALUE X'000B'.
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I'm not sure what this
Quote: |
based on the COPY book where the part of the file is destroyed. I tried using a binary transfer but the output was all more different than using ASCII.
|
means.
As i mentioned earlier, if you transfer the file in binary, the packed fields will be intact but you will have to translate all of the other fields to ascii.
Unless you are, or will become, familiar with how to do this (so far there seem to be few tools on the Windows platform to do this kind of thing - lots of vendors say they do this, but so far i've not seen one that just plugs in and works for all cases) you will save MUCH time if you format the data on the mainframe before downloading it. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Since it seems that the bulk of your data is ok, like I said before, you just may have to pre-translate certain portions of your data...... |
|
Back to top |
|
|
sundar83
New User
Joined: 16 Mar 2006 Posts: 2
|
|
|
|
Can anyone give me the JCL for FTP. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Look at the link to the previous topic posted above. |
|
Back to top |
|
|
|