View previous topic :: View next topic
|
Author |
Message |
kris22_24
New User
Joined: 28 Oct 2006 Posts: 18
|
|
|
|
I have a file having 1000 records in it, I need to fetch only last 4 records in that file ,Please say How can i do tht? |
|
Back to top |
|
 |
Binaya
New User

Joined: 03 Jul 2007 Posts: 77 Location: Hyderabad
|
|
|
|
You can do it by sorting right.
SORT FIELDS=COPY
STARTREC=996
kris22_24 wrote: |
I have a file having 1000 records in it, I need to fetch only last 4 records in that file ,Please say How can i do tht? |
|
|
Back to top |
|
 |
kris22_24
New User
Joined: 28 Oct 2006 Posts: 18
|
|
|
|
Yes we can do tht using sort, but i need it by using File Aid |
|
Back to top |
|
 |
Binaya
New User

Joined: 03 Jul 2007 Posts: 77 Location: Hyderabad
|
|
|
|
Sorry it is
SORT FIELDS=COPY
STARTREC=997 |
|
Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Try this is FILEAID
Code: |
//SYSIN DD *
$$DD01 COPYBACK OUT=4
/* |
|
|
Back to top |
|
 |
Binaya
New User

Joined: 03 Jul 2007 Posts: 77 Location: Hyderabad
|
|
|
|
We can use copy utility/ Selection Criteria Options/ Starting record key
. . . . . . . . . . . . . . . . . . . . . . . . . . .
File-AID -------------- Selection Criteria Options --------------------------
COMMAND ===>
Specify Selection Criteria Options:
Start at the following record key
(both blank for start of dataset)
Starting record key ===>
- OR - OR at the following RBA or RRN
Starting RBA or RRN ===>
Initial records to skip ===> 0 then skip this many records
Subsequent Selection Interval: then repeat the following
Records to select ===> 1 - select this many records
Records to skip ===> 0 - then skip this many records
until
Number of records to search ===> ALL you have read this many records
Number of records to select ===> ALL or selected this many records
SEQ/VSAM processing direction ===> F (F = Forward; B = Backward)
Use ENTER to return to selection criteria menu |
|
Back to top |
|
 |
vcjadhav Warnings : 1 New User

Joined: 27 May 2008 Posts: 19 Location: India
|
|
|
|
I tried Copyback and it threw RC=08 any reason for it? |
|
Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Yes, you did something wrong. As you were careful not to show messages, we can't say exactly what.
ETA: I just realized that this thread has been re-opened after nearly six years. Perhaps that's the problem  |
|
Back to top |
|
 |
vcjadhav Warnings : 1 New User

Joined: 27 May 2008 Posts: 19 Location: India
|
|
|
|
I think, I found the problem, it looks like, we cant give PDS(member) as the input file. It works only with flat or VSAM file but not with PDS member. |
|
Back to top |
|
 |
|