View previous topic :: View next topic
|
Author |
Message |
SCARCEBOYZ
New User
Joined: 16 May 2005 Posts: 32 Location: Millenium Business Park, Mumbai
|
|
|
|
I have a input dataset of length 1900. My requirement is to create an output dataset of 1902 by prefixing a value say '01' in the input dataset. I'm able to do this by siffixing a value at end but I am curious to know that how can we prefix a value using Overlay parameter.
Below is my JCL to add a suffix in a dataset using overlay.
Code: |
//STEP224 EXEC PGM=SYNCSORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=value_to_be_passed_length_01,DISP=SHR <<< contains FLD1,'01'
//SORTIN DD DSN=Input_File_length_1900,DISP=SHR
//SORTOUT DD DSN=output_dataset,
// DISP=(,CATLG,),
// SPACE=(CYL,(30,30),RLSE)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1901:FLD1)
/*
//
|
How can I use overlay option for adding a value at start.
Regards,
Vivek |
|
Back to top |
|
|
yogeshpawar
New User
Joined: 01 Mar 2006 Posts: 37 Location: Sussex-UK
|
|
|
|
Hi,
I think you want field to be added at the start of the record which will be an insert operation for i/p record. Then you can use BUILD for this. |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
IEBGENER offers you the possibility to compose a file from constants and input. The utility manual can tell you all |
|
Back to top |
|
|
srinathangya
New User
Joined: 19 Dec 2005 Posts: 77
|
|
|
|
Hi Buddy,
Guess, the option OVERLAY is to write over the record in the Input Dataset. This means U can only overwrite the record and U cant insert a new value in the begining of the record. Instead, you can use SORT program to insert a new value in the starting position.
And the JCL is
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INPUT.DATASET,DISP=SHR => Record length 80
//SORTOUT DD DSN=OUTPUT.DATASET,DISP=SHR => Rec Length 81
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(C'1',2:1,80) => Inserts '1' in position 1 in output rec.
/*
I believe this will work.
Reg,
Srinath. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
This SORT JOB with OVERLAY feature appends every record of the i/p file with the characters "01"
Code: |
//******************************************
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT= *
//SORTIN DD *
KK1
KK2
KK3
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(3:1,77,1:C'01')
/* |
SORTOUT
|
|
Back to top |
|
|
|