The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
bash: "undefined variable" and pipe nagaidhlig Shell Programming and Scripting 6 02-18-2008 10:47 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
By angle-brackets/"pipe" button doesn't work? riwa Linux 1 04-02-2006 06:43 PM
Unix "at" / "Cron" Command New Problem...Need help Mohanraj UNIX for Dummies Questions & Answers 3 01-26-2006 08:08 PM
Commands on Digital Unix equivalent to for "top" and "sar" on other Unix flavour sameerdes UNIX for Advanced & Expert Users 1 08-28-2002 08:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-20-2008
seshendra seshendra is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 1
Encoding Problem while using "|" (PIPE) as delimiter from Mainframe to Unix

We are facing a problem with PIPE (|) as a delimiter in one of our FTP flat files.
  1. We are constructing a Flat file in IBM-AIX and this contains various strings delimted by PIPE Symbol and then FTPing this to a Mainframe System
  2. The Mainframe program simply recieves this and FTPs the same (with our any manipulations) to another IBM-AIX machine
  3. As soon as the File is recieved on the third system, all the delimiters (|s) are being replaced by "M-3"

Earlier we used comma (,) as the delimiter and never faced such an issue. Now we have changed it to PIPE and are in this situation.

Is there anything to do specifically with PIPE when transferring files between Mainframe & UNIX?

Is there any work around for this without changing the delimiter symbol from PIPE to some another?
  #2 (permalink)  
Old 02-20-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
Probably the reason for this is some ASCII-EBCDIC conversion problem: Unix machines, including AIX machines, encode files in ASCII (American Standard Code for Information Interchange) character sets. Not so the IBM-hosts, as they traditionally use a different character set called EBCDIC (Extended Binary Coded Decimal Interchange Code).

Usually there is some sort of conversion table, which tells the conversion program what character number x is to be replaced with in the other character set. Probably this conversion table is faulty at the place of the pipe character. I would bet on "M-3" not being a 3-character string like its representation here in this text but in fact some single-char non-printable character.

You can either correct this conversion process or run sed (or tr) over the file to correct the characters:

Code:
tr '<bad-char>' '|' <sourcefile> > <corrected_file>
sed 's/<bad-char>/|/g' <sourcefile> > <corrected_file>
I hope this helps.

bakunin
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0