Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ascii characters...

Status
Not open for further replies.

eccom

Technical User
Jan 9, 2003
5
US
I am by no means a technical person, but here is my problem. I have an 80-byte file that is transferred from the mainframe to a windows environment. When a space appears (on MF) in the 80th field it is replaced by a carriage return line end character (OD OA), when transferred to windows.

Is there a script or anything I can use to read the space, then write the carriage return and line end characters???
 
sed 's/.$//' # assumes that all lines end with CR/LF
sed 's/^M$//' # in bash/tcsh, press Ctrl-V then Ctrl-M


sed 's/^M$//' input.txt > output.txt

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."
 
Use "binary" mode on your ftp client to prevent end-of-line conversions. This should fix it.



Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
Thank you for your reply, this is very useful information.

Rod,
Just out of curiousity...is there a solution that can be used with MQ
 
Given that I can only guess that you might mean MQ Series middleware, which we're not using, I'm probably not the one to ask. :)

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
MQ Series probably wouldn't do that because it transports data, but MQSI might because it will transform data based on rules.

If you run MQ, then your MQ Administrator should be able to do (or answer) what you want.
 
You might also find this useful:
Assuming you're FTP session is started from the non-MF system, use command "quote help site" to get the MF to list its help for the site command, and it should display something that includes this:
Code:
214-TRAILINGBLANKS  RETURNS TRAILING BLANKS FOR FIXED
214-                FORMAT DATA SETS THAT ARE RETRIEVED.
214-NOTRAILINGBLANKS REMOVES TRAILING BLANKS FOR FIXED
214-                FORMAT DATA SETS THAT ARE RETRIEVED.
So you can use command "quote site trail" or "quote site notrail" accordingly.

If you're FTP session starts from the MF, use command "locsite trail" or "locsite notrail".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top