MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Spliting a file based on the key field range

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Thu May 03, 2007 12:49 pm    Post subject: Spliting a file based on the key field range Reply with quote

Hi ,

Please help me to find the solution for the below mentioned requirement

There is an i/p data set each record contains deptcode 1 to 100 and some other fields ,requirement is to split the i/p data set into multiple o/p data sets

1)records with deptcode as 1to10(range) should be populated in first o/p dataset
2) records with deptcode as 11to20(range) should be populated in second o/p dataset
3) records with deptcode as 21to30(range) should be populated in third o/p dataset



like this i need to split the i/p data set into multiple o/p data sets based on deptcode ranges

Note: deptcode may contain duplicate values

i know that we can specify in the include cond of sort card
deptcode=1 or deptcode=2 or ---- etc but iam looking for simple solution where we can specify deptcode range 1-10 some thing like that .

Can any one help me regarding the same. how we can achieve this by using sort or fileaid or any other utility thru JCL.

Thanks in advance

Best regards
Rama krishna reddy
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Thu May 03, 2007 12:54 pm    Post subject: Reply with quote

Quote:

i know that we can specify in the include cond of sort card
deptcode=1 or deptcode=2 or ---- etc but iam looking for simple solution where we can specify deptcode range 1-10 some thing like that .


rama krishna reddy,

You are right on track

you can specify

Code:

outfil fnames=out1,include=(p,m,f,ch,ge,01,and,p,m,f,le,10)  $range 01 -10
outfil fnames=out2,include=(p,m,f,ch,ge,11,and,p,m,f,le,20)  $range 11 -20
outfil fnames=out3,include=(p,m,f,ch,ge,21,and,p,m,f,le,30)  $range 21 -30
...

p = dept position in the file
m = length of the field
f = format of the field (character, numeric...)


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rama krishna reddy
Beginner


Joined: 18 Sep 2006
Posts: 31
Topics: 13
Location: Hyderabad

PostPosted: Thu May 03, 2007 1:03 pm    Post subject: Reply with quote

Hi Kolusu

Thanks for the quick response
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group