Solved

Carriage Return Ascii code ???

Posted on 2003-11-04
12
66,302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Define binary variable in RPG free d specs 5 137
Data transfer to iSeries failing with message ID SQL0462 6 208
iSeries email authority 6 112
IBM i Break Messages 1 48
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

759 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