Editing with IEBGENER



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Editing with IEBGENER

Postby daloporhecho » Fri May 06, 2011 9:36 am

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.
daloporhecho
 
Posts: 32
Joined: Wed Dec 22, 2010 11:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Editing with IEBGENER

Postby Ronald Burr » Fri May 06, 2011 6:45 pm

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)
/*
Ronald Burr
 
Posts: 7
Joined: Wed Mar 23, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Editing with IEBGENER

Postby daloporhecho » Fri May 06, 2011 6:54 pm

Thank you Ronald, I'll try that.
daloporhecho
 
Posts: 32
Joined: Wed Dec 22, 2010 11:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Editing with IEBGENER

Postby daloporhecho » Fri May 06, 2011 8:58 pm

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)             
/*                                       
daloporhecho
 
Posts: 32
Joined: Wed Dec 22, 2010 11:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Editing with IEBGENER

Postby Ronald Burr » Fri May 06, 2011 9:18 pm

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).
Ronald Burr
 
Posts: 7
Joined: Wed Mar 23, 2011 8:18 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post