Page 1 of 1

Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 3:35 pm
by nikesh_rai
Hi Guys,

Is it possible to copy a part of record from one file to another file. Say a record of record length 200 and I want to copy record from 10th position to 100th position.

I know I can do it with SORT, SYNCSORT, ICETOOL, FILEAID and SAS as well. I wanted to know can we do the same thing with basic utilities like IEBGENER or IEBCOPY or IDCAMS. I have the same question for VSAM file also, I was checking for IDCAMS REPRO but didn't get any option with REPRO in my manual.

Please suggest me.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 3:59 pm
by Akatsukami
:roll:

You can't do it with JCL, of course, since JCL only establishes the environment.

You can do it with IEBGENER, although unless you're working on an extremely back-level system, that's equivalent to using your sort product.

You can't to do with IEBCOPY or IDCAMS; that's not what they're intended for.

Read the fine manuals for these utilities.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 4:48 pm
by Robert Sample
With a VSAM data set, you would need to unload it to a sequential data set and then apply IEBGENER appropriately -- or use SORT / SAS / FILEAID / .... directly on the VSAM data set.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 6:09 pm
by nikesh_rai
Thanks Akatsukami and Robert.. :)

I think IEBGENER can be used with RECORD FIELDS option. I got this one in one of my manuals. It should work but right now my mainframe environment is down, I can not check it.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 6:26 pm
by dick scherrer
Hello,

Is there some reason you want to use IEBGENER instead of your sort product?

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 6:42 pm
by nikesh_rai
No specific reason is there.. I just wanted to know if we can do it without SORT or not. and If we can, then how. Normally we always use SORT utility for this.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 8:37 pm
by dick scherrer
Hello,

Ok, i was just curious.

In addition to the ways mentioned above, you can also do this rather easily with Easytrieve.

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 9:43 pm
by nikesh_rai
no idea about Easytrieve.. :)

Re: Copy a portion of record using JCL

PostPosted: Thu Sep 19, 2013 9:53 pm
by dick scherrer
Hello,

Ask others if Easytrieve is installed on your system.

If it is, you can experiment with it.