Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Query: Function of overlay

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Query: Function of overlay
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    Post subject: Reply to: Query: Function of overlay
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 Moderator


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

PostPosted: Tue Nov 25, 2008 9:55 pm    Post subject:
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:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/

and:

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

and:

http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us