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
 

 

Splitiing the file into 10 equal parts.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Tue Mar 10, 2009 12:19 pm    Post subject: Splitiing the file into 10 equal parts.
Reply with quote

Here is my req..

I have an input file in which the data might always change.It has some millions of records and i want that file to be splitted into 10 equal parts.
Can we achieve that in a jcl with sort steps...

Please help.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 10, 2009 12:25 pm    Post subject:
Reply with quote

Have you searched the forum, because this has been asked and answered before.

Please search before posting !!!
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Mar 11, 2009 1:23 am    Post subject:
Reply with quote

Naresh,

Here is a sample SORT application:

Code:
//S1     EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=input.file,...
//SORTOF01 DD DSN=output.file1,...
   .
   .
   .
//SORTOF10 DD DSN=output.file10,...
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL FILES=(01,02,03,04,05,06,07,08,09,10),SPLIT
/*


Hope this helps.
Back to top
View user's profile Send private message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Thu Mar 12, 2009 1:12 pm    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

Thanks for the above solution...It is not giving me the reqd output..

I will explain my req with an example..
Consider my input is having 10001 records..i wanted to split into 10 files.So i want first 1000 in file1, next 1000 in file2.........and last 1001 in file10.

If the count is exactly divisible by 10..i can use spliyby...but that is not the case for me...

The record count in the input file always varies and may not be divisible by 10...
Back to top
View user's profile Send private message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Thu Mar 12, 2009 3:00 pm    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

i will give few more details on my req...

1.i have to get the record count of the input file
2.divide that by 10
3.give the quotient to the other step where we use SPLITBY function..

can we achieve this in a jcl with 1 r more sort steps..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 12, 2009 7:43 pm    Post subject:
Reply with quote

Hello,

Did you run the code Alissa provided?

If not, do so now and post back here what happens and if there is some reason this will not work for your requirement.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Mar 12, 2009 9:02 pm    Post subject:
Reply with quote

Dick,

I believe Naresh is saying that the "round-robin" technique of SPLIT is not what they need, but rather consecutive chunks of records in each OUTFIL...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 12, 2009 9:19 pm    Post subject:
Reply with quote

Hi Alissa,

Yup, you're probably right on - sorry 'bout that. . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 12, 2009 9:39 pm    Post subject:
Reply with quote

Naresh,

You can use the technique shown in the "Split a file to n output files dynamically" Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/

Note that SPLIT1R is a better choice than SPLITBY.
Back to top
View user's profile Send private message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Fri Mar 13, 2009 11:12 am    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

I have searched the forum and built a code according to my req...but giving some error..can anyone pls solve that..

1. i am creating a file with the following string and value generated dynamically.
Code:
SORT FIELDS=COPY                                             
OUTREC FIELDS=(C'  SPLIT1R=',1,15,ZD,DIV,+10,M11,LENGTH=15)
2. I am giving the above generated file in the following step..
Code:
//SYSIN    DD  *                               
  SORT FIELDS=COPY                             
  OUTFIL FILES=(01,02,03,04,05,06,07,08,09,10),
//         DD DSN=TEST.CNTL.CARD.COUNT,     
//            DISP=SHR                         
/* 

the error in the sysout is as follows
Code:
SYSIN :                                         
  SORT FIELDS=COPY                             
  OUTFIL FILES=(01,02,03,04,05,06,07,08,09,10),
    SPLIT1R=000000000001000                     
WER274A  CONTINUATION STATEMENT ERROR FOUND     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE



Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Fri Mar 13, 2009 12:59 pm    Post subject:
Reply with quote

nareshkareti,

SPLIT1R is Supported only by SyncSort 1.3 or later. Are you running an older version?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Mar 13, 2009 1:19 pm    Post subject:
Reply with quote

Hi,

if SPLIT1R is not supported, it would generate
Code:
WER274A  CONTINUATION STATEMENT ERROR FOUND


is there non blank values before SPLIT1R ?

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Mar 13, 2009 1:22 pm    Post subject:
Reply with quote

oops it should have said if SPLIT1R is not supported, it would not generate
Code:
WER274A  CONTINUATION STATEMENT ERROR FOUND


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

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Fri Mar 13, 2009 3:33 pm    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

I am using SYNCSORT FOR Z/OS 1.3.1.0N

The string in the cntl card file looks like this
Code:
----+----1----+----2----+--

    SPLIT1R=000000000001000
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Mar 13, 2009 5:06 pm    Post subject:
Reply with quote

Hi,

have you checked with HEX ON to see if the first 4 bytes are blank.

Also
Code:
OUTREC FIELDS=(C'  SPLIT1R=',1,15,ZD,DIV,+10,M11,LENGTH=15)
shows 2 spaces before SPLIT1R, yet
Code:
----+----1----+----2----+--

    SPLIT1R=000000000001000
shows 4 spaces.

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

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Fri Mar 13, 2009 5:33 pm    Post subject:
Reply with quote

Naresh,

The SYSIN control card is supposed to have an LRECL=80. Hence change your sort card in step1 to this,
Code:
OUTREC FIELDS=(C'  SPLIT1R=',1,15,ZD,DIV,+10,M11,LENGTH=15,80:X)
Back to top
View user's profile Send private message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Fri Mar 13, 2009 7:13 pm    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

Thank u very much Arun...
I made the lrecl of the cntl file as 80 and made the values after the string as spaces and it worked...

Here is how i built the cntl card
Code:
SORT FIELDS=COPY                                               
OUTREC FIELDS=(C'  SPLIT1R=',1,15,ZD,DIV,+10,M11,LENGTH=15,26:X)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Fri Mar 13, 2009 9:39 pm    Post subject:
Reply with quote

Naresh,

You're welcome. Glad that it worked for you. icon_smile.gif

But it should have been 80:X instead of 26:X
Back to top
View user's profile Send private message
nareshkareti

New User


Joined: 22 Jul 2008
Posts: 33
Location: Chennai

PostPosted: Sun Mar 15, 2009 4:59 pm    Post subject: Reply to: Splitiing the file into 10 equal parts.
Reply with quote

Arun,

Could you please tell me why it should be 80:X...as the first 25 places are occupied by the string..
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Mar 15, 2009 8:48 pm    Post subject:
Reply with quote

Hi,

What LRECL do you expect for the outputs?
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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