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: 6967
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: 4648
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: 1228
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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