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

Splitting on Ranges.


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

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue Jun 23, 2009 6:12 pm
Reply with quote

Hi

I have two files. File1 is a VB file and LRECL is 500. Second file (File2) is a FB file and LRECL is 80.

In File1 the KEY which is 6 digit present in 4th position and is ZD.
In File2 the lower range starts from 1st position and is 6 bytes of length and upper range starts from 10th position and is of 6bytes length. But the ranges are PD.

My requirement is to create an output file based on the Key present in the range of File2.

EX
FILE1
...123456....
...567676...

...999999....

FILE2

000001...666666

So consodering the above example, the output should contain only two records from File1 marked in RED
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Tue Jun 23, 2009 8:05 pm
Reply with quote

Hi Suzeet,

If i understood your requirement correctly, then only one record is present in file 2.

Sol:
store the lower range and higher range values of file 2 in SYMBOLS and in the next step use the symbols to INCLUDE the records that fall in the range.

The sample one can be seen in the below link
www.ibmmainframes.com/viewtopic.php?t=35171&highlight=
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: Tue Jun 23, 2009 9:33 pm
Reply with quote

suzeet,

Here's a DFSORT job that will do what I think you asked for. I'm assuming there's only one record in file2 with two PD values.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file2 (FB/80)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    BUILD=(C'TARG1,+',1,6,PD,TO=ZD,80:X,/,
           C'TARG2,+',10,6,PD,TO=ZD)
/*
//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file1 (VB/500)
//SORTOUT DD DSN=...  output file (VB/500)
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(8,6,ZD,GE,TARG1,AND,8,6,ZD,LE,TARG2)
/*
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 Splitting group records based on deta... DFSORT/ICETOOL 8
No new posts Splitting a file into multiple files ... DFSORT/ICETOOL 7
No new posts logically splitting a CICS region - help CICS 3
No new posts Splitting one record in a file to 10 ... DFSORT/ICETOOL 9
No new posts Splitting one row into multiple Rows ... DFSORT/ICETOOL 9
Search our Forums:

Back to Top