rama krishna reddy Beginner
Joined: 18 Sep 2006 Posts: 31 Topics: 13 Location: Hyderabad
|
Posted: Thu May 03, 2007 12:49 pm Post subject: Spliting a file based on the key field range |
|
|
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 |
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Thu May 03, 2007 12:54 pm Post subject: |
|
|
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
www.linkedin.com/in/kolusu |
|