What's the difference between sequential line sequential?
What's the difference between sequential line sequential?
Hi,
What is the difference between sequential and line sequential files? Do they need differnt processing from COBOL?
What is the difference between sequential and line sequential files? Do they need differnt processing from COBOL?
Thanks,
Rudhra
Rudhra
- Robert Sample
- Global Moderator
- Posts: 1891
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What's the difference between sequential line sequential
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.
Note that line sequential is used more often with Windows and Unix COBOL compilers; it is almost never seen on a z/OS system.
Re: What's the difference between sequential line sequential
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
Rudhra
- Robert Sample
- Global Moderator
- Posts: 1891
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What's the difference between sequential line sequential
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).
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).
- Anuj Dhawan
- Founder
- Posts: 2801
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: What's the difference between sequential line sequential
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.
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.
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.
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