Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
FTP a file to PC with hexadecimal data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
crazyf1

New User


Joined: 05 May 2006
Posts: 27

PostPosted: Thu Jan 18, 2007 3:05 pm    Post subject: FTP a file to PC with hexadecimal data
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: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:11 pm    Post subject:
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: 27

PostPosted: Thu Jan 18, 2007 3:16 pm    Post subject: Re: FTP a file with hexadecimal
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: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:24 pm    Post subject:
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: 27

PostPosted: Thu Jan 18, 2007 3:54 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Jan 18, 2007 3:58 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jan 18, 2007 10:13 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jan 18, 2007 10:48 pm    Post subject:
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:

http://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: 27

PostPosted: Fri Jan 19, 2007 8:22 am    Post subject:
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

Site Director


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

PostPosted: Fri Jan 19, 2007 9:24 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Jan 19, 2007 2:39 pm    Post subject:
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    Post subject: Re: FTP a file to PC with hexadecimal data
Reply with quote

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

Moderator Team Head


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

PostPosted: Mon Jan 22, 2007 5:12 pm    Post subject: Re: FTP a file to PC with hexadecimal data
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us