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

Need an explaination for outfil overlay


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Mon Nov 19, 2007 4:47 pm
Reply with quote

Hi when I run this JCL :
Code:
//STEP1 EXEC PGM=SORT                                   
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD *                                           
AAA111111BBB                                             
/*                                                       
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS),SPACE=(CYL,(1,1))
//*SORTOUT DD SYSOUT=*                                   
//SYSIN  DD *                                           
  OPTION COPY                                           
  OUTFIL BUILD=(1,3,6C'0',C'{',10,3)                     
/*                                                       
//STEP3 EXEC PGM=SORT                                   
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD DSN=&&TEMP,DISP=(OLD,PASS)                   
//SORTOUT DD SYSOUT=*                                   
//SYSIN DD *                                             
  OPTION COPY                                           
  OUTFIL OVERLAY=(4:4,6,ZD,ADD,+03,M11,LENGTH=06)       
/*

I get the following o/p:
Code:
AAA000003{BBB


But when I use the overlay statement as:
Code:
OUTFIL OVERLAY=(4,6,ZD,ADD,+03,M11,LENGTH=06)

I get the o/p as:
Code:
000003000{BBB


May I know why this happens?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Nov 19, 2007 5:29 pm
Reply with quote

When you specify OVERLAY without the destination position like this
Code:
OUTFIL OVERLAY=(4,6,ZD,ADD,+03,M11,LENGTH=06)

The default destination would be position 1, so the data in the position 1 in your o/p is overlayed.

Where as when you specify the destination position "4:" like this
Code:
OUTFIL OVERLAY=(4:4,6,ZD,ADD,+03,M11,LENGTH=06)
the o/p is overlayed in position 4.

2.4.14 Reformatting Records with OVERLAY

OVERLAY SYNTAX
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Mon Nov 19, 2007 5:52 pm
Reply with quote

Hi Krisprems

Quote:
The default destination would be position 1, so the data in the position 1 in your o/p is overlayed


In this case the o/p should have been:

Code:
000003111{BBB

isn't it?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Nov 19, 2007 6:13 pm
Reply with quote

Learncoholic
o/p of your first step is
Code:
AAA000000{BBB
So,
position 1-6 you have => AAA000
remaining data => 000{BBB
Then in the second step when you specify
Code:
OUTFIL OVERLAY=(4,6,ZD,ADD,+03,M11,LENGTH=06)

ie.., 000000 + 3 = 000003
and the default o/p position is 1, so
position 1-6 you will have => 000003 in the place of AAA000 , followed by
remaining data => 000{BBB.

Final o/p would be
Code:
000003000{BBB
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Mon Nov 19, 2007 6:20 pm
Reply with quote

Hi krisprems
I got it. Thank you so much
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Nov 19, 2007 6:27 pm
Reply with quote

You are welcome icon_cool.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts BNDS and Overlay command TSO/ISPF 9
No new posts Issues with outrec overlay while extr... SYNCSORT 7
Search our Forums:

Back to Top