Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How do you copy selected records using IDCAMS REPRO?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Lisa Christina

New User


Joined: 09 Jul 2008
Posts: 6
Location: Portland, Oregon

PostPosted: Wed Aug 06, 2008 10:53 pm    Post subject: How do you copy selected records using IDCAMS REPRO?
Reply with quote

I would like to use the IDCAMS REPRO command to copy the first record in the file and then the last 500 records in the file. How do I accomplish that task?

Anybody have JCL examples?

Can you use more than one FROMKEY & TOKEY in the REPRO command?

Thanks.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Aug 06, 2008 11:22 pm    Post subject:
Reply with quote

Both FROMKEY/TOKEY and FROMNUMBER/TONUMBER....
Click and see for yourself.....
Back to top
View user's profile Send private message
Lisa Christina

New User


Joined: 09 Jul 2008
Posts: 6
Location: Portland, Oregon

PostPosted: Thu Aug 07, 2008 12:52 am    Post subject: Reply to: How do you copy selected records using IDCAMS REPR
Reply with quote

Thank you...it worked perfectly.

REPRO INFILE (INFILE) -
OUTFILE (OUTFILE) -
FROMKEY (20080801) -
TOKEY (99999999)
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Aug 07, 2008 12:53 pm    Post subject:
Reply with quote

Hi Lisa,

Thanks for posting the solution.. icon_smile.gif


- Ad
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Thu Aug 07, 2008 1:54 pm    Post subject:
Reply with quote

Hi Anuj,

I dont know whether I am missing something here.

Code:
REPRO INFILE (INFILE) -
OUTFILE (OUTFILE) -
FROMKEY (20080801) -
TOKEY (99999999)


Will this copy the first record and then the last 500 records from the input file.

Thanks,
Arun
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 2:33 pm    Post subject: Reply to: How do you copy selected records using IDCAMS REPR
Reply with quote

Arc,

Quote:
Will this copy the first record and then the last 500 records from the input file.


Even i doubt this. I don't think this REPRO command would work for OP's requirement.

Lisa,

Could you please let us know the exact solution?
Back to top
View user's profile Send private message
Lisa Christina

New User


Joined: 09 Jul 2008
Posts: 6
Location: Portland, Oregon

PostPosted: Thu Aug 07, 2008 9:47 pm    Post subject:
Reply with quote

The solution:

It copied records from key "20080801" to key "99999999" (which is the last record in the file).

It DID NOT copy the first record, which I really wanted. But the first record was a dummy record (all low-values) so I just inserted one when I edited the test file. (I know, I cheated but I needed to get my testing done!)

I forgot to try if I could use more than one FROMKEY and TOKEY in my REPRO statement. I couldn't find that information in the docs Aaru referred me to.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 08, 2008 12:11 am    Post subject:
Reply with quote

Hello Lisa and welcome to the forums,

Quote:
I forgot to try if I could use more than one FROMKEY and TOKEY in my REPRO statement
If you need to do something like this again, you might run multiple steps and mod the output from steps 2 - n onto the back of the output from step1.
Back to top
View user's profile Send private message
Lisa Christina

New User


Joined: 09 Jul 2008
Posts: 6
Location: Portland, Oregon

PostPosted: Fri Aug 08, 2008 1:17 am    Post subject:
Reply with quote

Okay I'll try that approach next time.

Thanks!
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us