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

How to use overlay to prefix a value to a dataset ?


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

New User


Joined: 16 May 2005
Posts: 32
Location: Millenium Business Park, Mumbai

PostPosted: Mon Jan 28, 2008 5:03 pm
Reply with quote

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
View user's profile Send private message
yogeshpawar

New User


Joined: 01 Mar 2006
Posts: 37
Location: Sussex-UK

PostPosted: Mon Jan 28, 2008 9:02 pm
Reply with quote

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
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 29, 2008 12:04 am
Reply with quote

IEBGENER offers you the possibility to compose a file from constants and input. The utility manual can tell you all icon_wink.gif
Back to top
View user's profile Send private message
srinathangya

New User


Joined: 19 Dec 2005
Posts: 77

PostPosted: Tue Jan 29, 2008 8:58 am
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 29, 2008 12:33 pm
Reply with quote

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
Code:
01KK1
01KK2
01KK3
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top