Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

splitting a huge file into smaller ones using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Bina reddy nalla

New User


Joined: 05 May 2008
Posts: 2
Location: hyderabad

PostPosted: Mon May 05, 2008 4:22 pm    Post subject: splitting a huge file into smaller ones using REXX
Reply with quote

Hi
how do we split a huge file(around 65000 recs) into smaller recs using
REXX

below is a program for only 8 recs in a file

Code:

...                             
"EXECIO * DISKR INPUT (FINIS STEM INARRAY."                             
P = 1                                             
Q = 5                                             
DO WHILE P <= 7                                 
  DO I=P TO Q                                       
    SAY INARRAY.I
    QUEUE INARRAY.I           
  END       
  "EXECIO "QUEUED()" DISKW OUTPUT (FINIS"
  P = P+3                                           
  Q = Q+3                                           
END 


thr is an error regd the allocation of output file,
we are not understanding how to put the split output into a separate output file.

thanks & Regards
bina
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon May 05, 2008 4:33 pm    Post subject:
Reply with quote

Quote:

thr is an error regd the allocation of output file,


well if it is error rex000199 then you have allocated a file on tape.

if the error is rex0001998 then you have to many do loops.

if the error is not one of the above, it might be helpful to see a trace and error list. otherwise, you will have to debug on your own.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Mon May 05, 2008 5:07 pm    Post subject: Reply to: splitting a huge file into smaller ones using REXX
Reply with quote

1. Read a record. When EOF, close the input, the output, and exit.
2. Add 1 to the input record count.
3. If less than the split value, push record to the stack. Else, close the output, create a new stack, reset the input record count, then push the record to the stack, and assign a new DD to the output.
4. Write record to output.
5. Goto 1.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Mon May 05, 2008 5:45 pm    Post subject:
Reply with quote

1. If you want a relevant answer, you have to give all the information:
Do you want to split the file on a specific value in the record, or just by counting ?

2. In both case, you should consider using SORT. It will be faster than any REXX you can write.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon May 05, 2008 5:50 pm    Post subject:
Reply with quote

yes, IMHO Rexx is not the proper tool for this task, as Marso, I think you should try sort (dfsort, Syncsort...) they have specific options to split a file.
Back to top
View user's profile Send private message
Bina reddy nalla

New User


Joined: 05 May 2008
Posts: 2
Location: hyderabad

PostPosted: Wed May 07, 2008 10:36 am    Post subject: Reply to: splitting a huge file into smaller ones using REXX
Reply with quote

Thanks all
i wil try using syncSORT or dfSORT
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us