Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 66397
  • Last Modified:

Carriage Return Ascii code ???

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
ilovekeat
Asked:
ilovekeat
  • 2
  • 2
  • 2
  • +3
1 Solution
 
daveslaterCommented:
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
 
shalomcCommented:
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
theo kouwenhovenCommented:
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
 
ilovekeatAuthor Commented:
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
 
ilovekeatAuthor Commented:
okey, that's the question wrote from my friend.

hope you guys expert can get a clearer picture.

cheers
0
 
daveslaterCommented:
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
 
theo kouwenhovenCommented:
Hey GhostMod,

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

Accept Murphey2 comment as answer

0
 
GhostModCommented:
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
 
FerrostiCommented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now