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

Fetch only last 4 records from 1000 records using FILEAID


IBM Mainframe Forums -> Compuware & Other Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kris22_24

New User


Joined: 28 Oct 2006
Posts: 18

PostPosted: Fri Oct 26, 2007 11:26 am
Reply with quote

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
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Oct 26, 2007 11:54 am
Reply with quote

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
View user's profile Send private message
kris22_24

New User


Joined: 28 Oct 2006
Posts: 18

PostPosted: Fri Oct 26, 2007 11:58 am
Reply with quote

Yes we can do tht using sort, but i need it by using File Aid
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Oct 26, 2007 12:00 pm
Reply with quote

Sorry it is

SORT FIELDS=COPY
STARTREC=997
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri Oct 26, 2007 12:21 pm
Reply with quote

Hi,

Try this is FILEAID
Code:
//SYSIN    DD  *     
$$DD01 COPYBACK OUT=4
/*
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Oct 26, 2007 12:26 pm
Reply with quote

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
View user's profile Send private message
vcjadhav
Warnings : 1

New User


Joined: 27 May 2008
Posts: 19
Location: India

PostPosted: Thu Sep 05, 2013 8:14 pm
Reply with quote

I tried Copyback and it threw RC=08 any reason for it?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 05, 2013 8:23 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
vcjadhav
Warnings : 1

New User


Joined: 27 May 2008
Posts: 19
Location: India

PostPosted: Thu Sep 05, 2013 8:31 pm
Reply with quote

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
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 -> Compuware & Other Tools

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top