Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

writing cariage return character
My Cobol is RMCOBOL, And I am trying to I write new line into an
input.fil say my record is :

01 file-record.
02 emp_no pict 9(4).
02 filler pict x(2).
02 name pict x(20).
02 ---writing carraige return character--Howw  ???

Report this thread to moderator Post Follow-up to this message
Old Post
hpy_awad@yahoo.com
06-11-04 01:55 PM


Re: writing cariage return character
hpy_awad@yahoo.com wrote:
> My Cobol is RMCOBOL, And I am trying to I write new line into an
> input.fil say my record is :
>
> 01 file-record.
>    02 emp_no pict 9(4).
>    02 filler pict x(2).
>    02 name pict x(20).
>    02 ---writing carraige return character--Howw  ???

02  file-crlf   pic x(2).

....
MOVE X'0D0A' to file-crlf.

If your SELECT statment contains

ORGANIZATION IS LINE SEQUENTIAL

the compiler will insert these characters for you automatically. In other
words, each record becomes two bytes longer than your FD definition and
these extra two bytes contain 0D0A (carriage return/line feed).



Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
06-11-04 01:55 PM


Re: writing cariage return character
"hpy_awad@yahoo.com" <ehab_aziz2001@yahoo.com> wrote in message
news:7ecaee57.0406110348.41b7d270@posting.google.com...
> My Cobol is RMCOBOL, And I am trying to I write new line into an
> input.fil say my record is :
>
> 01 file-record.
>    02 emp_no pict 9(4).
>    02 filler pict x(2).
>    02 name pict x(20).
>    02 ---writing carraige return character--Howw  ???

I doubt you are *writing* to an *input* file, but easiest way to do this
"when ORGANIZATION IS SEQUENTIAL" is

01 file-record.
02 emp_no pict 9(4).
02 filler pict x(2).
02 name pict x(20).
02 rec-term               PIC X(01).

MOVE x'0D' to  rec-term of File-Record

For PC-termination, you should move carriage return PLUS line feed, so
change rec-term to PIC X(02) and  move x'0D0A' to it.

But, you might want to look at ORGANIZATION IS LINE SEQUENTIAL. If you use
this, record termination will be handled by the compiler.

MCM



MCM






Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
06-11-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:22 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.