Solved

Carriage Return Ascii code ???

Posted on 2003-11-04
12
66,242 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 32

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 32

Expert Comment

by:shalomc
ID: 9677883
0
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now