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

Sorting input files into multiple files using ranges


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

New User


Joined: 20 May 2005
Posts: 16

PostPosted: Wed Aug 27, 2008 12:44 pm
Reply with quote

Hi All

I have 5 input files with recfm = vb and lrecl=20476
We have to create 38 output files out of these 5 input files based on the conditions specified

NIC " A999999999"
NIC " B999999999"
NIC " E999999999"
NIC " F999999999"
NIC " GB09999999
NIC " GB19999999
NIC " GB39999999
NIC " GB99999999"
NIC " G999999999"
NIC " P999999999"
NIC " RP19999999
NIC " RP29999999
NIC " RP39999999
NIC " RP99999999
NIC " R999999999"
NIC " S999999999"
NIC " TL99999999"
NIC " TM09999999
NIC " TM29999999
NIC " TM99999999
NIC " TR09999999
NIC " TR19999999
NIC " TR29999999
NIC " TR99999999
NIC " T999999999
NIC " Z999999999
NIC " 0K43999999"
NIC " 0K46999999"
NIC " 0K99999999"
NIC " 0999999999"
NIC " 9999999999"
CLI " L999999999"
CLI " M099999999"
CLI " M999999999"
CLI " ZZ99999999"
CLI " 9999999999"

The first three characters are the company code and the rest is the master key and we need to create 38 files using this condition as follows :

For ex :

1) For company code NIC all the master key starting from A and rest all will go to one file
2) For company code NIC all the master key starting from B and rest all will go to one file
3) similarly for E
4) similarly for F
5) similarly for GB0
6) Here for company code nic and master key starting from GB1 to GB2 range
7) Here for company code nic and master key starting from GB3 only
8) Here for company code nic and master key starting from GB4 onwards to to GB99999999 range

Similarly the pattern follows

In input file the company code starts at position 5 and Master key starts at positon 13 since the file is vb.

Hope i am clear need help on this
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Aug 27, 2008 11:08 pm
Reply with quote

Quote:
Hope i am clear


Unfortunately, you're not.

If you want to create multiple output files based on different conditions, the basic DFSORT syntax would be:

Code:

     OPTION COPY
     OUTFIL FNAMES=OUT1,INCLUDE=(condition1)
     OUTFIL FNAMES=OUT2,INCLUDE=(condition2)
     ...


However, in order to help you fill in the conditions, I'd have to understand the "rules" you want to use and they aren't clear. So if you need more help, I need to know the following and see a good example of input and expected output.

Are the records you show from the input file, or one of the output files, or what?

Quote:
In input file the company code starts at position 5 and Master key starts at positon 13 since the file is vb.


A VB file has an RDW in positions 1-4, so the first data byte starts at position 5, not position 1. Did you count the RDW when you gave the positions, or does the company code really start at position 9 (5+4) and the Master key really start at position 17 (13+4)?

Quote:
1) For company code NIC all the master key starting from A and rest all will go to one file


Do you mean that all input records that have 'NIC' in positions 9-11 and 'A' in position 17 go to one output file, or do you mean something else? If something else, state the "rules" more clearly.

Quote:
Here for company code nic and master key starting from GB1 to GB2 range


Do you mean that all input records that have 'NIC' in positions 9-11 and 'GB1', 'GB2' or 'GB3' in positions 17-19 go to one output file, or do you mean something else? If something else, state the "rules" more clearly.

It would really help if you would show an example of the records in the input file and the corresponding records you expect in the various output files.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top