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 

Parent - Child Relation

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


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Thu Jul 17, 2003 2:53 pm    Post subject: Parent - Child Relation Reply with quote

Hi ,

Is it possible thru ICETOOL ?

Code:

Input1:

Dept   Name
----   ------
EEE    ELECTRICAL
ECE    ELECTRONICS
CSE    COMPUTER

Input2:  Currently Deptname is blank
------
#    Name      Dept     Deptname(all blanks currently)
---  --------  ---      ------------
001  AAAAA     CSE
002  BBBBB     CSE
003  CCCCC     EEE
004  DDDDD     ECE
005  ABABA     CSE


Expected output: Enriching the INPUT2 with INPUT1
-----------------------------------------------------------
#    Name      Dept     Deptname(all blanks currently)
---  --------  ---      ------------
001  AAAAA     CSE      COMPUTER
002  BBBBB     CSE      COMPUTER
003  CCCCC     EEE      ELECTRICAL
004  DDDDD     ECE      ELECTRONICS
005  ABABA     CSE      COMPUTER


Just like DB2 foreign key concept.

Please advice me how to do it?
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Jul 17, 2003 5:33 pm    Post subject: Reply with quote

Hsubra,

Yes, you can do this with the new SPLICE operator of DFSORT's ICETOOL available with DFSORT R14 PTF UQ90053 (Feb, 2003). For complete information on SPLICE, see:

http://www.storage.ibm.com/software/sort/mvs/uq90053/online/srtmutol.html#spl

Here's the DFSORT/ICETOOL job. I've assumed your input files have RECFM=FB and LRECL=80. If not, the job can be adjusted accordingly.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//INPUT1 DD DSN=... input file 1
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//    DD DSN=...    input file 2
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
* Reformat input file 1 so it can be spliced with input file 2
  COPY FROM(INPUT1) TO(T1) USING(CTL1)
* Splice input file 1 and input file 2 together
  SPLICE FROM(CON) TO(T2) ON(16,4,CH) WITHALL WITH(1,13)
* Sort on the # field
  SORT FROM(T2) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(16:1,4,25:8,12,80:X)
/*
//CTL2CNTL DD *
  SORT FIELDS=(1,3,CH,A)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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