Solved

Carriage Return Ascii code ???

Posted on 2003-11-04
12
66,266 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Start QSH command from CL 19 1,069
Using iSeries QSH to list files in IFS directory with a long path name 5 249
DB2 return first match 3 111
Compatibility MOVEX 10A on V6R1 9 84
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

803 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