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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to use overlay to prefix a value to a dataset ?
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    Post subject: Reply to: How to use overlay to prefix a value to a dataset
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jan 29, 2008 12:04 am    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


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