Reading and Writing Variable length datasets in PL/I 
Author Message
 Reading and Writing Variable length datasets in PL/I

Can anybody help me out? I have a Varying Block Sequential Dataset
with a Record Length of 1000. I need to read in this dataset and write
it out to another dataset with the same attributes. Easy enough if I
was writing out to a Fixed Block dataset. However, as the record
length in the input dataset needs to match exactly the record length
in the output dataset for each record, I am unsure of how to proceed.
Does anyone know how to do this?


Tue, 12 Apr 2005 13:42:39 GMT  
 Reading and Writing Variable length datasets in PL/I
There's nothing "special". Just use READ and WRITE on RECORD files, and
define the files (ENV / DD / ALLOC) as they are. If you wish to read into
fixed-definition structures (rather than into char(1000) var) and don't know
up front what structure the next record has, use locate mode I/O to get a
pointer, then used BASED access to overlay the right structure.

In all cases, PL/I will read the next (variable length) record.



Quote:
> Can anybody help me out? I have a Varying Block Sequential Dataset
> with a Record Length of 1000. I need to read in this dataset and write
> it out to another dataset with the same attributes. Easy enough if I
> was writing out to a Fixed Block dataset. However, as the record
> length in the input dataset needs to match exactly the record length
> in the output dataset for each record, I am unsure of how to proceed.
> Does anyone know how to do this?



Tue, 12 Apr 2005 16:13:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Write variable length records....

2. Writing variable line length text

3. Writing variable line length text

4. Reading variable-length records from a file

5. Attempting to read variable length records as raw data

6. Variable length records (How to define/read)

7. MVS: Reading variable length recs as input

8. More on reading variable length files

9. How to read variable length files

10. How to read a binary file with variable length record

11. Reading variable length records...

12. Reading variable length character strings

 

 
Powered by phpBB® Forum Software