IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FTP a file to PC with hexadecimal data


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Thu Jan 18, 2007 3:05 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:11 pm
Reply with quote

The hex part you don't want tranlated?
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Thu Jan 18, 2007 3:16 pm
Reply with quote

Yes. We want to retain the correct output for this.
Correct OUTPUT
Quote:

 % _%? @@ #end#


FTP OUTPUT (Wrong)
Quote:

^
? #end#
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:24 pm
Reply with quote

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
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Thu Jan 18, 2007 3:54 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:58 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Jan 18, 2007 10:13 pm
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jan 18, 2007 10:48 pm
Reply with quote

dick scherrer wrote:
To do what you want sending packed/binary values, ftp the file in binary (not ascii).


The same recommendation I made on the same topic in a previous post:

ibmmainframes.com/viewtopic.php?t=14974&highlight=
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Fri Jan 19, 2007 8:22 am
Reply with 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.

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Jan 19, 2007 9:24 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Jan 19, 2007 2:39 pm
Reply with quote

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
View user's profile Send private message
sundar83

New User


Joined: 16 Mar 2006
Posts: 2

PostPosted: Mon Jan 22, 2007 3:30 pm
Reply with quote

Can anyone give me the JCL for FTP.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jan 22, 2007 5:12 pm
Reply with quote

Look at the link to the previous topic posted above.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts db2 vs static data COBOL Programming 1
No new posts External data queue (changes?) CLIST & REXX 0
No new posts Pull data using date difference betwe... DB2 6
No new posts fast data scrambling PL/I & Assembler 10
Search our Forums:

Back to Top