What's the difference between sequential line sequential?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Rudhra
Registered Member
Posts: 11
Joined: Wed Dec 18, 2013 10:17 am

What's the difference between sequential line sequential?

Post by Rudhra »

Hi,

What is the difference between sequential and line sequential files? Do they need differnt processing from COBOL?
Thanks,
Rudhra
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What's the difference between sequential line sequential

Post by Robert Sample »

The Enterprise COBOL Language Reference Manual indicates that line sequential is reserved to only HFS (Unix System Services) files. Line sequential is text stream I/O, which means you can read individual bytes (or sets of bytes) rather than reading sequential records. If you are writing programs for z/OS, you are using sequential files -- period. ONLY if you are writing programs to access Unix System Services text stream files would you use line sequential.

Note that line sequential is used more often with Windows and Unix COBOL compilers; it is almost never seen on a z/OS system.
Rudhra
Registered Member
Posts: 11
Joined: Wed Dec 18, 2013 10:17 am

Re: What's the difference between sequential line sequential

Post by Rudhra »

I read that LDS is also "line sequential" and we use them in DB2 - so they are under zOS? But as you say, if you are writing programs for z/OS, you are using sequential files - does that mean a COBOL can't read an LDS?
Thanks,
Rudhra
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What's the difference between sequential line sequential

Post by Robert Sample »

A VSAM Linear Data Set -- which is what I assume you meant by "LDS" -- is a VSAM file and hence cannot be considered sequential as it is defined in terms of controlintervals and controlareas. A VSAM LDS cannot be read at a record level -- which will cause a problem for a COBOL program since COBOL works on records. It may be possible to read an LDS in COBOL using DIV (Data-In-Virtual) but I have not done any research to find out if this is possible.

The main two uses for LDS data sets are DB2 (which controls ALL access to the LDS and hence cannot be read in COBOL), and z/FS file systems (which again cannot be read in COBOL -- although it MAY be possible to read a file in the z/FS file system using COBOL).
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: What's the difference between sequential line sequential

Post by Anuj Dhawan »

LDS has unstructured 4k fixed size CIs and these CIs do not contain control fields. And so, they do not contain any logical records (a requirement for COBOL, as Robert has also said).

Hope this helps.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Rudhra
Registered Member
Posts: 11
Joined: Wed Dec 18, 2013 10:17 am

Re: What's the difference between sequential line sequential

Post by Rudhra »

Thanks Robert and Anuj.
Thanks,
Rudhra
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”