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

INCLUDE COND parameters from a dataset.


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

New User


Joined: 31 Jan 2008
Posts: 30
Location: Woodland Hills, CA

PostPosted: Tue Apr 15, 2008 11:23 am
Reply with quote

Hi,

Can we get the include condition parameters ('1234567') from a dataset?

SORT FIELDS=COPY
INCLUDE COND=(1,6,CH,EQ,C'1234567')

In the above example I have the data '1234567' in a dataset and I need to extract records from another dataset based on this parameter (Which is in first dataset).

In my case the first dataset have 1 lakh records. I need to automate this using a sort. Can we do this using SORT/ICETOOL or any other utility.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Tue Apr 15, 2008 12:32 pm
Reply with quote

can you post a few records of input and expected output
Back to top
View user's profile Send private message
jithumohan

New User


Joined: 31 Jan 2008
Posts: 30
Location: Woodland Hills, CA

PostPosted: Tue Apr 15, 2008 12:48 pm
Reply with quote

Thanks for the response

First file(key file): LRECL = 12
YYYYYCCCCCCC
CCCC1234567
OOOOCCCCCCC

Second file (input file): (Matching record 9:12)
RRRR1234OOOOCCCCCCC
RYYR1234OOOyy999999
BBBB1234YYYYYCCCCCCC
UUUU1234CCCC1234567
RRRR1234OOOO9kk9999
RRRR1234OOOOCCCCCCC
BBBB1234CCCC1234567
UUUU1234YYYYYCCCCCC
RRRR1234OOOO9999999
88888888OOOOCCCCCCC

Output file records should be as follows.

RRRR1234OOOOCCCCCCC
BBBB1234YYYYYCCCCCCC
UUUU1234CCCC1234567
RRRR1234OOOOCCCCCCC
BBBB1234CCCC1234567
UUUU1234YYYYYCCCCCC

Could you please let me know if you have any doubts.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 15, 2008 12:57 pm
Reply with quote

Take a look at the ICETOOL SELECT parameter, although you may have to reformat the records of one file to ensure that the two keys have a matching location.

I do have an example somewhere, and will try to find it later if I get time, although there are many examples in the forum already.
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 Apr 15, 2008 9:33 pm
Reply with quote

Jithu,

Here's a DFSORT/ICETOOL job that will do what you asked for using SPLICE:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/12)
//IN2 DD DSN=...  input file2 (FB/20)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/20)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(9,12,CH) -
  WITHALL WITH(1,29) USING(CTL3)
SORT FROM(T2) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
  INREC BUILD=(9:1,12,29:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(21:SEQNUM,8,ZD,29:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=T2,INCLUDE=(29,2,CH,EQ,C'VB'),
    BUILD=(1,28)
/*
//CTL4CNTL DD *
  SORT FIELDS=(21,8,ZD,A)
  OUTREC BUILD=(1,20)
/*
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 Apr 15, 2008 9:35 pm
Reply with quote

Quote:
Take a look at the ICETOOL SELECT parameter


SELECT won't work here because there are duplicate records in file2. SPLICE is required for that.
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top