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

Line-sequential files vs. others...
Hi,

Just wanted to confirm a couple of things about "line-sequential"
file. Read in the z/os docs that it means a file with only printable
chars, with each record seperated by a newline.

It also mentioned that physical records would be of different sizes as
trailing spaces are chopped off. This means that if we have a copybook
with the last entry as say 10 FILLER X(5). Then if in one record we
had a string of 3 chars the remaining 2 spaces would not be wriiten to
the file ?
ALso this would only be valid for alphanumerics as numerics are right
aligned so u'd never get trailing spaces. How about an array ? does
this rule hold for all elements in the array (unlikely) and only for
the last cell in the array (inconsistent)?

Only printable chars means DISPLAY usage. What is a file which
contains numerics with COMP's and the DISPLAY stuff mixed up called ?
Are there sequential files of this format as well ?

Is there anyplace where one can get hold of some sample sequential
ebcdic data files along with their copybooks. These seem really hard
to come by as opposed to say xml's and their xsd's !

Thanks

Report this thread to moderator Post Follow-up to this message
Old Post
Ed
08-18-04 08:55 AM


Re: Line-sequential files vs. others...
Ed wrote:
> Hi,
>
> Just wanted to confirm a couple of things about "line-sequential"
> file. Read in the z/os docs that it means a file with only printable
> chars, with each record seperated by a newline.
>
> It also mentioned that physical records would be of different sizes as
> trailing spaces are chopped off. This means that if we have a copybook
> with the last entry as say 10 FILLER X(5). Then if in one record we
> had a string of 3 chars the remaining 2 spaces would not be wriiten to
> the file ?
> ALso this would only be valid for alphanumerics as numerics are right
> aligned so u'd never get trailing spaces. How about an array ? does
> this rule hold for all elements in the array (unlikely) and only for
> the last cell in the array (inconsistent)?
>
> Only printable chars means DISPLAY usage. What is a file which
> contains numerics with COMP's and the DISPLAY stuff mixed up called ?

Depends on the compiler. Usually it is called "Sequential" as opposed to
"Line Sequential"

> Are there sequential files of this format as well ?
>
> Is there anyplace where one can get hold of some sample sequential
> ebcdic data files along with their copybooks. These seem really hard
> to come by as opposed to say xml's and their xsd's !



You may be making this harder than it really is. Here's the drill:
1. Record is built in the FD whose record is defined to be length "x"
2. Pgm finds, in the whole record, "y" trailing spaces.
3. Pgm writes a record of "x-y" + 1 (or 2) bytes. [1=X'0D', 2=X'0D0A']

So a record defined to be 1000 bytes can be anything from 1 to 1002 bytes of
actual media space. Anything less than 1000 is blank-filled when the record
is read.

You can WRITE a record with COMP fields. You just won't be able to read it!

Here's why:

Eventually the read routine will encounter a COMP field that looks like
{CR/LF or NewLine} and terminate the data transfer. On a read, the pgm can't
tell the difference between data and control characters.



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


Re: Line-sequential files vs. others...
"JerryMouse" <nospam@bisusa.com> wrote in message
news:B-udnTUXB9URaYbcRVn-ow@giganews.com...
> Ed wrote: 
>
> Depends on the compiler. Usually it is called "Sequential" as opposed to
> "Line Sequential"
> 
>
>
>
> You may be making this harder than it really is. Here's the drill:
> 1. Record is built in the FD whose record is defined to be length "x"
> 2. Pgm finds, in the whole record, "y" trailing spaces.
> 3. Pgm writes a record of "x-y" + 1 (or 2) bytes. [1=X'0D', 2=X'0D0A']
>
> So a record defined to be 1000 bytes can be anything from 1 to 1002 bytes
of
> actual media space. Anything less than 1000 is blank-filled when the
record
> is read.
>
> You can WRITE a record with COMP fields. You just won't be able to read
it!
>
> Here's why:
>
> Eventually the read routine will encounter a COMP field that looks like
> {CR/LF or NewLine} and terminate the data transfer. On a read, the pgm
can't
> tell the difference between data and control characters.
>
>
Some systems (example: Microfocus on PC's) have extensions
for line sequential, but if you utilize these extensions, you lose
portability.

Eg, if you embed a control Z, it will likely not work elsewhere.




Report this thread to moderator Post Follow-up to this message
Old Post
Russell Styles
08-19-04 08:55 AM


Re: Line-sequential files vs. others...
"Russell Styles" <rNwOsS0P2A0M2@comcast.net> wrote in message
news:uN6dnWju8f-a2YHcRVn-sg@giganews.com...
<snip>
>         Some systems (example: Microfocus on PC's) have extensions
> for line sequential, but if you utilize these extensions, you lose
> portability.
>
>     Eg, if you embed a control Z, it will likely not work elsewhere.
>
>

EVERY compiler that supports "explicitly defined" LINE SEQUENTIAL files is
providing an extension to every ANSI or ISO Standard (but NOT to the X/Open
COBOL Standard).

Therefore each and every compiler vendor can say what they want about
- embedded control characters
- trailing spaces
- etc

I would agree, however, that you are MOST likely to not run into "portabilit
y"
problems for LINE SEQUENTIAL files if:

A) you use only "display" (possibly DBCS, Unicode, whatever) data, i.e. only
data that passes an IF ALPHANUMERIC class test (unless you are also using
Unicode data)

B) You strip off any trailing spaces before writes

C) You do NOT use the REWRITE feature (that some compilers allow) - at least
 not
when changing record lengths

D) Make certain that you "expand" tabs your self (to spaces)



--
Bill Klein
wmklein <at> ix.netcom.com



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
08-26-04 08:55 PM


Re: Line-sequential files vs. others...
"Russell Styles" <rNwOsS0P2A0M2@comcast.net> wrote in message
news:uN6dnWju8f-a2YHcRVn-sg@giganews.com...
<snip>
>         Some systems (example: Microfocus on PC's) have extensions
> for line sequential, but if you utilize these extensions, you lose
> portability.
>
>     Eg, if you embed a control Z, it will likely not work elsewhere.
>
>

EVERY compiler that supports "explicitly defined" LINE SEQUENTIAL files is
providing an extension to every ANSI or ISO Standard (but NOT to the X/Open
COBOL Standard).

Therefore each and every compiler vendor can say what they want about
- embedded control characters
- trailing spaces
- etc

I would agree, however, that you are MOST likely to not run into "portabilit
y"
problems for LINE SEQUENTIAL files if:

A) you use only "display" (possibly DBCS, Unicode, whatever) data, i.e. only
data that passes an IF ALPHANUMERIC class test (unless you are also using
Unicode data)

B) You strip off any trailing spaces before writes

C) You do NOT use the REWRITE feature (that some compilers allow) - at least
 not
when changing record lengths

D) Make certain that you "expand" tabs your self (to spaces)



--
Bill Klein
wmklein <at> ix.netcom.com



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
08-31-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 12:44 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.