Code Comments
Programming Forum and web based access to our favorite programming groups.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 ???
Post Follow-up to this messagehpy_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).
Post Follow-up to this message"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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.