Copy a portion of record using JCL



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

Copy a portion of record using JCL

Postby nikesh_rai » Thu Sep 19, 2013 3:35 pm

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.
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Copy a portion of record using JCL

Postby Akatsukami » Thu Sep 19, 2013 3:59 pm

: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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Copy a portion of record using JCL

Postby Robert Sample » Thu Sep 19, 2013 4:48 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Copy a portion of record using JCL

Postby nikesh_rai » Thu Sep 19, 2013 6:09 pm

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.
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Copy a portion of record using JCL

Postby dick scherrer » Thu Sep 19, 2013 6:26 pm

Hello,

Is there some reason you want to use IEBGENER instead of your sort product?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Copy a portion of record using JCL

Postby nikesh_rai » Thu Sep 19, 2013 6:42 pm

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.
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Copy a portion of record using JCL

Postby dick scherrer » Thu Sep 19, 2013 8:37 pm

Hello,

Ok, i was just curious.

In addition to the ways mentioned above, you can also do this rather easily with Easytrieve.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Copy a portion of record using JCL

Postby nikesh_rai » Thu Sep 19, 2013 9:43 pm

no idea about Easytrieve.. :)
Thanks
Nikesh Rai
nikesh_rai
 
Posts: 205
Joined: Tue Oct 18, 2011 1:27 am
Has thanked: 17 times
Been thanked: 0 time

Re: Copy a portion of record using JCL

Postby dick scherrer » Thu Sep 19, 2013 9:53 pm

Hello,

Ask others if Easytrieve is installed on your system.

If it is, you can experiment with it.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post