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

Query: Function of overlay


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

New User


Joined: 01 Nov 2008
Posts: 9
Location: chennai

PostPosted: Tue Nov 25, 2008 1:14 pm
Reply with quote

Here is the sample code snippet

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
1111             019    IN1
2222             020    IN1
4444             022    IN1
6666             024    IN1
8888             026    IN1
/*
//IN2 DD *
1111             019    IN2
2222             020    IN2
3333             021    IN2
4444             022    IN2
5555             023    IN2
6666             024    IN2
7777             025    IN2
8888             026    IN2
8888                    IN2
8888                    IN2
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=OUTFILE,
//             DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
//             SPACE=(CYL,(1,1),RLSE)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) ON(18,3,CH) -
  WITHALL WITH(1,81) KEEPNODUPS KEEPBASE USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,OMIT=(81,2,CH,EQ,C'VB'),
    BUILD=(1,80)
/*


I want to know how overlay behaves in above example

particularly how the temp file formatted with VB


IN1 is overlayed with 'BB' and IN2 is ovelayed with 'VV' at 81:2 position and copied to temp file.

how the temp file will have 'VB' for same keys ?

as per my understanding the temp file will have following for key 1111
after IN1, IN2 copied.

Code:

1111             019    IN1   BB
1111             019    IN2   VV


Pls clarify me how we are expecting VB in temp file
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Tue Nov 25, 2008 5:51 pm
Reply with quote

Hi,

Quote:
as per my understanding the temp file will have following for key 1111
after IN1, IN2 copied.

1111 019 IN1 BB
1111 019 IN2 VV

Pls clarify me how we are expecting VB in temp file


----------------------------------------------------------------------------------

Well you are correct, The temp file T1 wil have both these records after IN1 & IN2 have been copied to T1. There is no problem with overlay operator and it is works as you think.

Now, when you use splice operator with options :

SPLICE FROM(T1) TO(OUT) ON(1,4,CH) ON(18,3,CH) -
WITHALL WITH(1,81) KEEPNODUPS KEEPBASE USING(CTL3)
/*

The trick here is WITH(1,81)

The WITH operator tells you to take the fields from 2nd record.

1111 019 IN1 BB
1111 019 IN2 VV

This will give o/p ( it takes 1,81 fron IN2 & 82 pos from IN1)
1111 019 IN2 VB

Please let me know if there is any further confusion.
Thanks,
-Kapil
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 Nov 25, 2008 9:55 pm
Reply with quote

ganesh,

For more information on how this all works for various situations, see the following Smart DFSORT Tricks:

o Create files with matching and non-matching records
o Join fields from two files on a key
o Join records on a key with missing fields
o Join fields from two files record-by-record

at:

Use [URL] BBCode for External Links

and:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603

and:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13.2?DT=20060615185603#HDRSPLX
Back to top
View user's profile Send private message
ganesh_bv

New User


Joined: 01 Nov 2008
Posts: 9
Location: chennai

PostPosted: Tue Nov 25, 2008 10:05 pm
Reply with quote

Thanks for Kapil and Frank
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 RC query -Time column CA Products 3
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top