[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Reading Flat Files from SQR



At 12:17 PM 7/9/98 +0100, you wrote:
>Hello Srini,
>
>Yes it is easy to read flat files with SQR. We have used that opetunity a
>lot.
>
>1) Use OPEN to open the file(s).
>OPEN { filename_lit | _var } AS { filenum_int_lit | _var }
>{ FOR-READING | FOR-WRITING | FOR-APPEND }
>{ RECORD = length_int_lit [ :FIXED | :FIXED_NOLF | :VARY ] }
>[ STATUS = { num_var } ]

Some examples for different platform:

--MVS/DB2 batch
open 'DSN:userid.flat.file.TXT'             <-- specify DSN name
open 'DDN:INDATA'                           <-- specify DD name, preferred
     as 1 for-reading record=162:vary status=#filestat

and on IBM/OS390, even if the data is fixed block, read the record as
"vary" instead of as "fixed" to avoid the trailing blank problems.

------------------------------------------------------------    
 Analyst Programmer                 
 Administrative Information Services   
 Case Western Reserve University
 Cleveland OH 44106
 Email:  hxc15@po.cwru.edu
 Phone:  (216) 368-0401 (O)     	
         (440) 572-8965 (H)