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

Copying the Input dataset to new Output dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Mon Jul 31, 2006 12:19 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jul 31, 2006 1:41 pm
Reply with quote

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
View user's profile Send private message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Tue Aug 08, 2006 8:05 pm
Reply with quote

Thanks. Its working fine.

Regards
Suresh Nallusamy
Back to top
View user's profile Send private message
srinu14165
Warnings : 1

New User


Joined: 19 Jul 2006
Posts: 8

PostPosted: Tue Aug 15, 2006 8:25 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Aug 15, 2006 3:13 pm
Reply with quote

It looks like you haven't properly allocated a QSAM dataset to IN.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Aug 15, 2006 8:37 pm
Reply with quote

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
View user's profile Send private message
srinu14165
Warnings : 1

New User


Joined: 19 Jul 2006
Posts: 8

PostPosted: Fri Aug 18, 2006 6:29 am
Reply with quote

yep, it was working fine

Thanks everybody
Sri
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
Search our Forums:

Back to Top