IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How do you copy selected records using IDCAMS REPRO?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Wed Aug 06, 2008 11:22 pm
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
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

Superior Member


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

PostPosted: Thu Aug 07, 2008 12:53 pm
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: 2481
Location: @my desk

PostPosted: Thu Aug 07, 2008 1:54 pm
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: 1287
Location: Chennai, India

PostPosted: Thu Aug 07, 2008 2:33 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 08, 2008 12:11 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts Use Copy Utility DB2 7
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
Search our Forums:

Back to Top