Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2180
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us