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 input file into multiple output files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Sun Oct 27, 2013 1:50 am    Post subject: Splitting input file into multiple output files
Reply with quote

Hello,

I want to split my input file into multiple o/p files.
Input file has thousands of records.

I want to split in to 15000 record in to one O/P1 and other 15000 to O/P2 and so on.. But before splitting the file I want to check the last record is NOT "A" at first position.

I/P contains

A 2013
1234
B 21222

-
0 11221 TOTAL AMPUNT 2110.22

A12 2013
2235
B 41222
0 1111TOTAL AMPUNT 543.22
A02 2013

My outout should be

O/P1

A 2013
1234
B 21222

-
0 11221 TOTAL AMPUNT 2110.22

O/P2

A12 2013
2235
B 41222
0 1111TOTAL AMPUNT 543.22

O/P3

A02 2013

record format - FBA
lrecl-133

Can anyone suggest me how to acheive this using sort, icetool

thanks!
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sun Oct 27, 2013 4:57 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Have a look here.
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Mon Oct 28, 2013 9:14 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Hi Bill,

I'm not not clear that will satisfy my requirement.
My input has thousands of records...

For eg:
Input
A 2013
1234
B 21222
blanks
-
A 2013
1234
B 21222
o
blanks
A 2013
1234
B 21222

And want to split each out put should have 15000, while splitting It has to split the before record "A". While checking the condition the output doesn't have exactly 15000. but it should close to 15000, ie 14990 to 15100. The last output file should contain the rest of the records.. But the first record should start with "A"

Hope its clear.. Any help is appreciated..
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Mon Oct 28, 2013 1:06 pm    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Well, how about becoming clear whether it will satisfy your requirement? What is it specifically which makes you think it won't?

"Split a file but keeping groups together" seems to be what you want.
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Mon Oct 28, 2013 6:27 pm    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

I want the first 15000 records in OUT1 but the last record shouldn't be "A" record. Next 15000 in OUT2 but the first record should be "A" record.
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Tue Oct 29, 2013 12:02 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Ran using the sort card and I'm getting the below error.

OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,5),PUSH=(144:139,4))
*
OUTFIL FILES=01,INCLUDE=(144,4,ZD,EQ,00),BUILD=(1,133)
OUTFIL FILES=02,INCLUDE=(144,4,ZD,EQ,01),BUILD=(1,133)
OUTFIL FILES=OV,SAVE,BUILD=(1,133)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Any help
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Oct 29, 2013 12:23 am    Post subject:
Reply with quote

Please post the entire body of SYSOUT messages in Code tags.
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Tue Oct 29, 2013 12:45 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Here is the entire jcl

Code:
//STEP01   EXEC PGM=SORT                           
//SYSOUT DD SYSOUT=*                               
//SORTIN DD DSN=my.dataset.name,DISP=SHR
//SORTOF01 DD SYSOUT=*                             
//SORTOF02 DD SYSOUT=*                             
//SORTOFOV DD SYSOUT=*                             
//SORTOUT DD SYSOUT=*                             
//SYSIN DD *         
//SYSIN DD *                                             
  OPTION COPY                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,10,ZD)),   
        IFTHEN=(WHEN=GROUP,BEGIN=(1,5),PUSH=(144:139,4))
  OUTFIL FILES=01,INCLUDE=(144,4,ZD,EQ,00),BUILD=(1,133)
  OUTFIL FILES=02,INCLUDE=(144,4,ZD,EQ,01),BUILD=(1,133)
  OUTFIL FILES=OV,SAVE,BUILD=(1,133)   


error is
Code:
WER251A  INCLUDE/OMIT INVALID FORMAT         
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


and the version is SYNCSORT 1.4.0.

Pls let me know if any additional details required.

Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Oct 29, 2013 6:19 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

I can't see anything wrong with either of the INCLUDEs, but your BEGIN is malformed. You have taken a DFSORT KEYBEGIN and chopped off the word KEY, I think.

SyncSort doesn't have KEYBEGIN. If you need to emulate it, look at SEQNUM with RESTART=
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Oct 29, 2013 6:34 am    Post subject:
Reply with quote

Hi,

I think there is another error you are not showing.



Gerry
Back to top
View user's profile Send private message
PORYES

New User


Joined: 04 Apr 2007
Posts: 29
Location: Chennai

PostPosted: Tue Oct 29, 2013 7:52 am    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Is there a way I can extract multiple blocks,

ie 1 st record to 15000, and check the last record before write?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Tue Oct 29, 2013 2:56 pm    Post subject: Reply to: Splitting input file into multiple output files
Reply with quote

Yes. You've made a start.

You make a sequence number for each record.

You make a GROUP using BEGIN= with the value "A". For this you PUSH the sequence number on to each record of the group.

You use the PUSHed sequence number in the OUTFILs for selection.

If the 15,000th is an A, all records of that group will have the PUSHed sequence number as 15000.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 24 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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