IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading Carriage Return characters from PC File


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gayathri

New User


Joined: 30 Nov 2005
Posts: 1
Location: India

PostPosted: Wed Nov 30, 2005 3:14 pm
Reply with quote

Hi,
I want know how carriage return characters are interpreted in Mainframes . The File will come from an outside system ( non - mainframe) . I want to check for the carriage returns in COBOL and replace them with spaces to be stored in Database.

Thanks
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Nov 30, 2005 5:04 pm
Reply with quote

As a file is transported over a network from an ASCII machine to an EBCDIC machine, a couple of events occur, presuming that the method of transport chosen will convert the ASCII code into EBCDIC code. As the datastream is passed through the communication channel, the individual bytes are translated (via a standard translation table) from their native ASCII hex value into their corresponding EBCDIC hex value. Whenever a Carriage-Return/Line-Feed pair (ASCII x'0D0A') is encountered, the two ASCII bytes are converted into the EBCDIC value for an IRS (Inter-Record Seperator) which will be a hex '1E', '1F', or '15' depending on the networking protocol. The IRS causes the current EBCDIC record to be written, and then starts a new record until the next IRS is encountered.

The only way you'd be able to see the CR/LF is if the file is transported in BINARY mode, in which case it will still be represented as a hex '0D0A'.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top