IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading a LDS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Oct 21, 2010 2:10 pm
Reply with quote

Is reading of LDS file possible via COBOL program?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 21, 2010 4:53 pm
Reply with quote

This is an interesting question. I suspect (but don't know for sure) that the answer may be yes, but not easily. COBOL file operations are record-oriented whereas an LDS has no records -- just bytes. You might be able to treat each 4K CI as a "record" in COBOL and read the data that way, but this is (obviously) not something I've tried so I'm not sure if it would work.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 21, 2010 5:44 pm
Reply with quote

apparently SAS can: support.sas.com/documentation/cdl/en/vsamref/61644/HTML/default/a003253039.htm

also,
Q What is a LDS ?
A A VSAM data set that contains data but no control information. A linear data set can be accessed as a byte-addressable string in virtual storage.

in the ibm redbook VSAM Demystified REFER to section 1.6.5 Linear data set (LDS)
and pay close attention to Data-in-Virtual.
also, section 1.13.3 zSeries File System (zFS)

but unless you are using z/OS UNIX,
why are you trying to read a VSAM LDS.

if this is a db2 lds, you are wasting everyone's time.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 21, 2010 6:04 pm
Reply with quote

Unix zFS files are defined as LDS as well. -- which is where all my experience with them comes from. Define it, grow the aggregate if needed, and mount it on a mount point is what I've done with them.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Oct 21, 2010 6:46 pm
Reply with quote

The DIV macro can be used to access a LDS.

publibfp.dhe.ibm.com/epubs/pdf/iea2a630.pdf

MVS Programming: Assembler Services Guide
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 21, 2010 8:27 pm
Reply with quote

From a web-link:
Quote:
LDS is a VSAM dataset in name only. It has unstructured 4k (4096 bytes) fixed size CIs which do not contain control fields and therefore from VSAM's standpoint they do not contain any logical records. There is no freespace, and no access from Cobol. Can be accessed by DB2 and IMS fast path datasets. LDS is essentially a table of data maintained on disk. The 'table entries' must be created via a user program and can only be logically accessed via a user program. When passed, the entire LDS must be mapped into storage, then data is accessed via base and displacement type processing.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 21, 2010 8:36 pm
Reply with quote

Thanks for the data, Anuj -- that's good to know.
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Fri Oct 22, 2010 8:51 am
Reply with quote

I want to check out the contents of DB2 LDS dataset for which I am trying to write a cobol prog. But before I go and write a program I wanted to check the feasibility.

This is just for sake of my curiosity about, how exactly DB2 is storing data into a LDS dataset. I want to see the content and compare the same with actual data.

If somebody from you all, can readily help me explaining the methodology DB2 follow in storing data into LDS then you are most welcome !!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Oct 22, 2010 9:27 am
Reply with quote

Hello,

Suggest you create a very small tablespace and dump this. Then load only a few rows into this. Then dump the data and review the output (using that very old utility IEBeyeball icon_smile.gif ).

I would discontinue the COBOL approach as i believe the effort invested will not be worth the result.

Keep in mind that the way the internals work can be changed without notice at any time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top