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

Need JCL to start reading the records from 2500th record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anandkumarrn

New User


Joined: 06 Feb 2009
Posts: 23
Location: India

PostPosted: Tue May 26, 2009 1:18 am
Reply with quote

Hi,

I need a JCL,

I have to count the number of active records(an indicator set to 'A') in a VSAM files and the VSAM file contains huge amount of data.
I have to start reading the records based on my input value(i.e. starting position of read to start processing) not from the first record of my file.

say i need to count first 1000 active records out of 5000 records. I need to start reading the records from 2500th record not from the first record. and i need to get the output as


Total active records:1000 records and
Processed records till: 4000(this 4000 is the number of records i have processed to get the 1000 active records).

I need this to be done thru JCL. Can any one help me???
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 26, 2009 2:18 am
Reply with quote

Hello,

JCL cannot do this. . . Some program must be executed. . .

It might be the sort or fileaid or some other utility, but it will not happen using only jcl.

Suggest you look within the forum as there are many similar topics. If you find something that is not clear, post what you found and your doubt. SOmeone will be able to clarify.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 26, 2009 2:13 pm
Reply with quote

Hi,

We can try to acheive this using Option "SUBSET" available.

SUBSET is a new ICETOOL operator that allows you to create a subset of the input or output records with specific header, trailer, and relative records, or without specific header, trailer, and relative records. SUBSET gives you new capabilities for keeping or removing the first n records of your data set, the last n records of your data set, and/or specific relative records in your data set. SUBSET does not require an "identifier" in the records to be kept or removed; it keeps track of the first n records, relative record numbers, and the last n records automatically.

The syntax for the SUBSET operator is as follows:
SUBSET FROM(indd) TO(outdd) DISCARD(savedd) KEEP|REMOVE INPUT|OUTPUT
HEADER|FIRST|HEADER(x)|FIRST(x)
RRN(x)|RRN(x,y)|RRN(x,) ...
TRAILER|LAST|TRAILER(x)|LAST(x)
USING(xxxx) VSAMTYPE(x)

Example: As an example, you could use the following SUBSET operator to keep the first two input records, the fifth, sixth and seventh input records, and the last input record.
SUBSET FROM(IN) TO(OUT) KEEP INPUT FIRST(2) RRN(5,7) LAST

Do let me know if you need any further detail on this option SUBSET.

Thanks,
Jagadesh.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue May 26, 2009 8:18 pm
Reply with quote

itjagadesh,

How does this relate to the original requirement posted by the TS?

anandkumarrn
,

Why dont you write a little code to achieve this?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue May 26, 2009 9:40 pm
Reply with quote

Try this link. Its a must read book by Frank (Really good)

www-947.ibm.com/systems/support/storage/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue May 26, 2009 10:48 pm
Reply with quote

vasanthz,

Yes, Of course it's a really good book. Can you point out the trick in the above document which relates to the topic under discussion here.

I am confused. icon_rolleyes.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top