Page 1 of 1

Editing with IEBGENER

PostPosted: Fri May 06, 2011 9:36 am
by daloporhecho
Hello people,

I need to copy a dataset with IEBGENER modifying the first 5 positions of the first record to certain value (leaving the rest of the records as they are). I tried to understand it from the manual and searched for examples with no much luck.
Is there a way to do that with IEBGENER or another system tool via JCL?

Thanks a lot for your help.

Re: Editing with IEBGENER

PostPosted: Fri May 06, 2011 6:45 pm
by Ronald Burr
If you KNOW the value of any 'constant' in the first record (it does not have to be unique to the first record) then the following will do what you want:

//SYSIN DD *
  GENERATE MAXFLDS=3,MAXGPS=1
GRP1 RECORD IDENT=(length-of-record-1-constant,’constant-value-in-apostrophes’,start-location-of-constant),
  FIELD=(5,'your-new-constant-in-apostrophes',,1),FIELD=(6,record-length-minus-5,,6)
GRP2 RECORD FIELD=(1,record-length,,1)
/*

Re: Editing with IEBGENER

PostPosted: Fri May 06, 2011 6:54 pm
by daloporhecho
Thank you Ronald, I'll try that.

Re: Editing with IEBGENER

PostPosted: Fri May 06, 2011 8:58 pm
by daloporhecho
This is the working result, few changes but couldn't even have started without your help Ronald, thanks.
MAX parameters are just exaggerations but they do it nicely as anyone can wish. For future readers: record lenght is 120.
//SYSIN    DD *                         
  GENERATE MAXFLDS=9,MAXGPS=9,MAXLITS=999
GRP1 RECORD IDENT=(5,'01056',1),         
            FIELD=(5,'87654',,1),       
            FIELD=(115,6,,6)             
GRP2 RECORD FIELD=(120,1,,1)             
/*                                       

Re: Editing with IEBGENER

PostPosted: Fri May 06, 2011 9:18 pm
by Ronald Burr
Thanks for the update - and thanks for correcting the (now obvious) syntax errors in the code that I posted (with so many products with similar, but different, syntax, I have a hard time remembering what comes first - length or location - and often get them wrong on the first try).