Solved

Carriage Return Ascii code ???

Posted on 2003-11-04
12
66,283 Views
Last Modified: 2011-08-18
Hi

i am asking behalf of my friend.

What is the ascii code for the carriage return in AS400?

charachter=13??? or ??

i dont know what exact thing my friend looking for...but sort of ascii code for the Enter button key.

any help?
0
Comment
Question by:ilovekeat
  • 2
  • 2
  • 2
  • +3
12 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 9677142
Hi
I am using a program to write to the ifs in ascii format. I am using x'OD' = ascii 13 and x'25' = ascii 10.

If you are trying to output text on a new line then you need to output both the OD & 25 codes

If you are using the API's to write ascii to the IFS I have enounted different results depending on if the file was craeted on the PC or created using the API's.

If any other experts have any additional info please can you add it. It has fustrated me.

Dave
0
 
LVL 33

Expert Comment

by:shalomc
ID: 9677711
Hey,
The problem is that different OS treat end-of-line differently.
In the DOS, Windows and OS/2 both CR and LF (13 and 10) are needed.
Unix uses only LF.
The older versions of Macintosh use only CR.
The newer versions of Mac OS X use only LF.

When you FTP an AS400 database file, the client and server should deal with end of line properly.
When you FTP an IFS file in ASCII mode, the client and server should deal with end of line properly.
When you FTP an IFS file in Binary mode, what you have in the original file is exactly what will be in the target file.
If you use the built-in commands like CPYTOSTMF, CPYFRMSTMF, CPYFRMIMPF, CPYTOIMPF, they can convert the EOL properly.
If you write a program to create a text file in IFS - it is up to you to programatically determine the proper EOL sequence.
0
 
LVL 33

Expert Comment

by:shalomc
ID: 9677883
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 9678126
As you probably know, AS/400 isn't working with ASCII but with the EBCDIC character code table.
If you look to the ASCII-EBCDIC table on http://www.flash.net/~gwstern/ascii_ebcdic.html

you can see all ASCII codes with the EBCDIC replacement vv.

See also
http://www.dynamoo.com/technical/ebcdic.htm
http://www.dynamoo.com/technical/ascii.htm

Regards,

Murphey
0
 

Author Comment

by:ilovekeat
ID: 9687638
Hi Shalomc,
  I am writing a program using Lotus Script to create text file in AS400 server. In which I've to remove all carriage returns. My question is, how shall i go about it? Currently i use "chr(13)" to recognise the carriage return. It works fine in NT server but not in AS400. What is the correct "code" for AS400 to recognise that it's a carriage return?

  Your help is much appreciated.

Regards,
Eunice
0
 

Author Comment

by:ilovekeat
ID: 9687699
okey, that's the question wrote from my friend.

hope you guys expert can get a clearer picture.

cheers
0
 
LVL 14

Expert Comment

by:daveslater
ID: 9687739
Hi
What I woudl do is simply write the data to a text file and shell to a batch FTP command PUTting or APPENDing the data to the as/400.

pc commands are in ftp.ftp

userid password
put c:\temp\myfild.txt   as400lib.file
quit


the shell command is

shell ftp -s:ftp.ftp as400 ipaddress

This should do everything you need


dave


0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 10866925
Hey GhostMod,

Didn't you read the Administrative Comment of DaveSlater???

Accept Murphey2 comment as answer

0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10871547
Sorry about that Murphey.  But as I read this thread, it looks as though the asker tried your suggestion, but it didn't work.  Because of this, I am not going to award points.  I am going to PAQ/No refund.

PAQd and 40 points not refunded

GhostMod
CS Moderator
0
 
LVL 6

Expert Comment

by:Ferrosti
ID: 11048607
For what I think that could have happened (I know this thread is already closed...):

If the same file has been transferred from Windows to AS/400 using FTP in ASCII mode the CRLF would have been encoded from ASCII to EBCEDIC. If BINARY would have been used as transfer method the CRLF is the same hex numbers as usual under ASCII specific to Windows (013, 010).
So, first of all one has to evaluate where the data has been entered to find out which code has been used for the "ENTER" key and then one has to make sure that it has not been modified on the way through the systems.

A search for chr(013) will find CR, but not LF. This will result in a logical CRLF on a Linux system for example, since Linux needs LF for linebreaks only.

Possible chars for linebreaks are:
EBCEDIC: 013, 037 (CR/LF) or in hex: 0x0D, 0x25
ASCII: 013, 010 (CR/LF) or in hex: 0x0D, 0x0A

HTH, Ferrosti
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a cohesive image for your brand is vital to making an impression on consumers. When the economy is tough, brands do better than unbranded  products. This can have a huge impact on your long-term profits, as the economy goes up and down.
Read our guide on how to survive being on-call.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question