View previous topic :: View next topic
Author
Message
Learncoholic New User Joined: 20 Sep 2007Posts: 97 Location: India
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:
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:
May I know why this happens?
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
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
Learncoholic New User Joined: 20 Sep 2007Posts: 97 Location: India
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:
isn't it?
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
Learncoholic
o/p of your first step is
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
Back to top
Learncoholic New User Joined: 20 Sep 2007Posts: 97 Location: India
Hi krisprems
I got it. Thank you so much
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
You are welcome
Back to top
Please enable JavaScript!