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

Split files upto certain limit based on groups using dfsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bubbu75

New User


Joined: 14 Nov 2017
Posts: 2
Location: India

PostPosted: Tue Nov 14, 2017 11:11 pm
Reply with quote

Hi
I have a VB file with record length 2250(2246+4).This file consists of groups of specific pattern., I need to split this file into 8 splits every time since the file can have a maximum of 3,70,000 groups.each split should have 50,000 groups only. If it's less than maximum limit say only 70,000 groups in input file then 1st split should have 50,000, second 20,000 and rest of the files should get created as an empty file. These splits has to be gdg's. Please let me know how to achieve this using dfsort.

Also I need a trailer in each file at end with count of groups in that file. For example if input has 70,000 groups ( not no of lines) the 1st file trailer should have 50,000 as count. Second file should have 20,000as count in trailer.

My group pattern
00000000000
xxx
Xxx
Xxx
99999999999
00000000000
Xxx
Xxx
99999999999
00000000000
Xx
99999999999

Here my file always has 11 digit zeros 00000000000 as start of the group and 11 digit 9's as end of the group.this is same for all the groups but the content in between start and end of the groups will change. Thanks in advance!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Nov 14, 2017 11:17 pm
Reply with quote

All right, What have you tried so far, RTFM atleast?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Tue Nov 14, 2017 11:19 pm
Reply with quote

Did you try to DO SOMETHING AT ALL by yourself? What are the results of your attempts?

This forum is supposed to help others in fixing encountered issues, and to clarify sophisticated terms.

This forum is not supposed to do others' jobs in full. At least - not free of charge.
Back to top
View user's profile Send private message
bubbu75

New User


Joined: 14 Nov 2017
Posts: 2
Location: India

PostPosted: Wed Nov 15, 2017 6:38 pm
Reply with quote

Hi,
sorry I missed to include the code after writing a long query.

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'00000000000'),
END=(1,11,CH,EQ,C'99999999999'),PUSH=(2251:ID=8))

OUTFIL NAMES=SORTOF01,INCLUDE(2251,8,ZD,LT,51000),
BUILD=(5:5,2246)
OUTFIL NAMES=SORTOF02,
INCLUDE(2251,8,ZD,GT,50000,OR,2251,8,ZD,LT,100001),
OUTFIL NAMES=SORTOF03,
INCLUDE(2251,8,ZD,GT,100000,OR,2251,8,ZD,LT,151000),
.
.
.
.
OUTFIL NAMES=SORTOF08,SAVE,BUILD=(5:5,2246)

MY input file is vb,recl=2250(2246+4), all my 8 o/p files are vb,recl=2250(2246+4). I am getting error with the above code. it says "POTENTIALLY IINEFFICIENT USE OF INREC", "SORT01 OUTREC RDW NOT INCLUDED".. I tried the same code with fb it worked.i don't know how to give the positions in vb..I know its bit different because of that 4 bytes
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Nov 15, 2017 10:55 pm
Reply with quote

bubbu75 wrote:
Hi,
sorry I missed to include the code after writing a long query.

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'00000000000'),
END=(1,11,CH,EQ,C'99999999999'),PUSH=(2251:ID=8))

OUTFIL NAMES=SORTOF01,INCLUDE(2251,8,ZD,LT,51000),
BUILD=(5:5,2246)
OUTFIL NAMES=SORTOF02,
INCLUDE(2251,8,ZD,GT,50000,OR,2251,8,ZD,LT,100001),
OUTFIL NAMES=SORTOF03,
INCLUDE(2251,8,ZD,GT,100000,OR,2251,8,ZD,LT,151000),
.
.
.
.
OUTFIL NAMES=SORTOF08,SAVE,BUILD=(5:5,2246)

MY input file is vb,recl=2250(2246+4), all my 8 o/p files are vb,recl=2250(2246+4). I am getting error with the above code. it says "POTENTIALLY IINEFFICIENT USE OF INREC", "SORT01 OUTREC RDW NOT INCLUDED".. I tried the same code with fb it worked.i don't know how to give the positions in vb..I know its bit different because of that 4 bytes

1. You MUST use 'Code' tags, to make your post viewable to readers (unless you hate all of other readers of your posts)

2. Definitely your syntax
Code:
OUTFIL NAMES=SORTOF02,
                        INCLUDE(2251,8,ZD,GT,50000,OR,2251,8,ZD,LT,100001),
OUTFIL NAMES=SORTOF03,
                       INCLUDE(2251,8,ZD,GT,100000,OR,2251,8,ZD,LT,151000),
.
.
is wrong. Nothing to talk about this

3. Your output record format definition
Code:
BUILD=(5:5,2246)
is wrong for RECFM=VB. This is exactly what error message "SORT01 OUTREC RDW NOT INCLUDED" is saying, but you prefer to ignore it, do you?

Please, fix your problems, step by step. Then we might continue (unless you are able to find yourself the obvious mistakes caused by your laziness)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Wed Nov 15, 2017 11:11 pm
Reply with quote

The message "SORT01 OUTREC RDW NOT INCLUDED" definitely states that you need to include RDW in your record definition

It must be done as
Code:
BUILD=(1,4,       this is RDW for RECFM=VB
       5:5,2246)  this is record body, after RDW

Those experts who don't know this syntax are advised to visit the Beginners Forum
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top