View previous topic :: View next topic
|
Author |
Message |
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
Copying the Input dataset to output dataset I have used the below REXX program.
Code: |
/*rexx*/
"ALLOC F(IN) DA('kv07342.file1.input') SHR"
"ALLOC F(OUT) DA('kv07342.file3.input') new"
'EXECIO * DISKR IN (STEM DATA. FINIS' /* copy file into stem*/
'EXECIO * DISKW OUT (STEM DATA. finis' /* copy using stem*/
"FREE F(IN,OUT)"
EXIT
|
This REXX program works fine, if the Input dataset has some records. But if the input dataset is empty, output dataset created without logical record length. ( When i try to open the output dataset it says INVALID BLOCK SIZE error ).
Please let me know how to resolve this problem. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Try:
"ALLOC F(OUT) DA('kv07342.file3.input') NEW LIKE('kv07342.file1.input')"
Attributes from the input file will be used to define the new output file |
|
Back to top |
|
|
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
Thanks. Its working fine.
Regards
Suresh Nallusamy |
|
Back to top |
|
|
srinu14165 Warnings : 1 New User
Joined: 19 Jul 2006 Posts: 8
|
|
|
|
Hi,
I have a problem in using the above code.
It gives me the below error when I try to execute the above code for copying all the records from input dataset to output dataset
IRX0553E The input or output file IN must be allocated to a sequential data
set, or single member of a partitioned data set.
IRX0670E EXECIO error while trying to GET or PUT a record.
Can anyone Pls help me out.
Thanks
Sri |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
It looks like you haven't properly allocated a QSAM dataset to IN. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
During EXECIO:
If the file is not allocated, you receive message IRX0555E.
If the file is a PDS, you receive message IRX0552E.
If the file is VSAM, you receive message IRX0553E.
Make sure the file is not already allocated. If it is, use "FREE F(IN)" before the ALLOC. |
|
Back to top |
|
|
srinu14165 Warnings : 1 New User
Joined: 19 Jul 2006 Posts: 8
|
|
|
|
yep, it was working fine
Thanks everybody
Sri |
|
Back to top |
|
|
|