MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Finding record no. using DFSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
oneofspace
Beginner


Joined: 18 Nov 2008
Posts: 33
Topics: 14

PostPosted: Sat Dec 13, 2008 2:47 am    Post subject: Finding record no. using DFSORT Reply with quote

Hi

I want to find the record no. of a particular record.

Consider there are n number of records in a ps file. In any one of the record in position 1 and of lenth 3 a word "SYS" will be there.
That corresponding record no. should be written to output file.

Input and Output are fixed length files of lrecl 80.

Input:

Code:
11111111111
22222222222
SYS33333333
44444444444
55555555555

Output:

Code:
3


Thanks
One
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Dec 13, 2008 11:31 am    Post subject: Reply with quote

You can use a DFSORT job like the following to do what you asked for. I used 1 digit for the record number as shown in your example. If appropriate, you can use more digits by changing the length of the SEQNUM field.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
11111111111
22222222222
SYS33333333
44444444444
55555555555
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY                                           
  INREC OVERLAY=(15:SEQNUM,1,ZD)                       
  OUTFIL INCLUDE=(1,3,CH,EQ,C'SYS'),BUILD=(1:15,1,80:X)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
oneofspace
Beginner


Joined: 18 Nov 2008
Posts: 33
Topics: 14

PostPosted: Mon Dec 15, 2008 7:55 am    Post subject: Reply with quote

Fantastic!!!!!!!!! Very Happy
Thank you very much Frank

One
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group