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 

How can I find out the number of records in a flat file?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
mcshastry
Beginner


Joined: 24 Nov 2005
Posts: 4
Topics: 4

PostPosted: Tue Nov 29, 2005 1:17 am    Post subject: How can I find out the number of records in a flat file? Reply with quote

How can I find out the number of records existing in a flat file?
One solution is open the file in VIEW mode and enter the command M<PF8> and see the number of lines.if the file contains a large number of records it is taking a lot of time to go to the last record.Is there any other method to count the records?
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Nov 29, 2005 1:51 am    Post subject: Re: How can I find out the number of records in a flat file? Reply with quote

mcshastry,

You can achieve this thru some sort utilities.Check these links.

http://www.mvsforums.com/helpboards/viewtopic.php?t=7&highlight=count
http://mvsforums.com/helpboards/viewtopic.php?t=2256&highlight=number+records
Back to top
View user's profile Send private message Send e-mail
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Tue Nov 29, 2005 1:59 am    Post subject: Reply with quote

You can try this tiny REXX as 3.4 command:
Code:
/* REXX */                                         
                                                   
ARG ZINPDSN                                         
                                                   
ZINPDSN = "'"STRIP(ZINPDSN,"B","'")"'"             
ADDRESS TSO "ALLOC FI(DUMM) DA("ZINPDSN") SHR"     
ADDRESS TSO "EXECIO * DISKR DUMM (STEM LI. FINIS"   
ADDRESS TSO "FREE FI(DUMM)"                         
SAY LI.0                                           
                                                   
EXIT                                               
                                                   

O.
________
MARIJUANA VAPORIZERS


Last edited by ofer71 on Thu Mar 17, 2011 10:42 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Nov 29, 2005 5:01 am    Post subject: Reply with quote

Provided the file isn't too large to EDIT or VIEW, this works fine, too:

Code:
/* REXX edit macro */                                         
Address ISREDIT "MACRO"                                       
Address ISREDIT "(N) = LINENUM .ZLAST"                         
N = strip(N,L,0)                                               
ZEDSMSG = N||' lines in this file'                             
ZEDLMSG = 'There are '||N||' lines in this file. Believe me!' 
Address ISPEXEC "SETMSG MSG(ISRZ001)"                         

_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Samuel
Beginner


Joined: 12 Aug 2004
Posts: 38
Topics: 10

PostPosted: Tue Nov 29, 2005 11:34 am    Post subject: Reply with quote

1) Logon to TSO.
2) Logon to ISPF.
3) Choose File-Aid option 3. 8 (Interactive Utility)
4) Enter the data set name.

EX: Input Dataset Information:
Dataset name ===> 'YOUR.DATA.SET NAME'
Volume serial ===> (If not cataloged)

5) Depress the enter key (you will be promted to enter a function)
6) Type TALLY and depress the enter key.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Dec 06, 2005 8:29 am    Post subject: Reply with quote

A "Flat File", as in a file that has no vertical depth, would contain no more than 1 physical record.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Dec 06, 2005 9:21 am    Post subject: Reply with quote

superk wrote:
A "Flat File", as in a file that has no vertical depth, would contain no more than 1 physical record.


Superk,

Can you share the source of that definition?

AFAIK Flat file is any file stored in a file access method without an index, which, of course, eliminates all DBMS. cf. flat file system, which refers to the directory that files are stored in, rather than the file itself. There are also non-relational DBMS known as flat file databases.

Flat file system is a directory system for files that does not have a hierarchy, which means there are no subdirectories, and each file name is unique.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Dec 06, 2005 10:29 am    Post subject: Reply with quote

I got these definitions from a web search:

  • Flat files are data files that contain records with no structured relationships. Additional knowledge is required to interpret these files such as the file format properties.

  • A computer file where all the information is run together in a signal character string.

  • A file consisting of records of a single record type, in which there is no embedded structure information governing relationships between records.

  • Said of a text file that contains only 7-bit ASCII characters and uses only ASCII-standard control characters (that is, has no embedded codes specific to a particular text formatter markup language, or output device, and no meta-characters).

  • Sometimes referred to as interface file, is designed to hold EDI data prior to and following translation or transmission to and from a trading partner.

  • An ASCII data file produced by a business application that is converted into ANSI ASC X12 format by translation software, and vice versa. It typically uses fixed-length format rather than variable length ANSI ASC X12 format. Also known as a User Defined File (UDF).

The last two definitions are the two that are most familiar to my interpretation of the term. Most of the definitions seem to only be applicable to data stored as ASCII files, not as MVS datasets. I don't know, maybe it's becoming a new term synonymous with QSAM or SAM or Sequential dataset.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Dec 06, 2005 12:29 pm    Post subject: Reply with quote

I've known it as a sequential data set (as opposed to a PDS, KSDS or other layout dependent data set) since the mid-80s. The term came about when DOS came out and we had to compare MVS's complex file structures to a PC's simple byte stream. 'Flat' meaning 'boring' or 'uninteresting'.
Back to top
View user's profile Send private message Visit poster's website
maheshwaran
Beginner


Joined: 17 Dec 2005
Posts: 1
Topics: 0
Location: Chennai

PostPosted: Sat Dec 17, 2005 7:06 am    Post subject: Reply with quote

Samuel wrote:
1) Logon to TSO.
2) Logon to ISPF.
3) Choose File-Aid option 3. 8 (Interactive Utility)
4) Enter the data set name.

EX: Input Dataset Information:
Dataset name ===> 'YOUR.DATA.SET NAME'
Volume serial ===> (If not cataloged)

5) Depress the enter key (you will be promted to enter a function)
6) Type TALLY and depress the enter key.


Hi I just want to know whether we can do the whole sequence in rexx..... Because i need the same process to find the no. of records for various files(around 10)
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Dec 17, 2005 9:33 am    Post subject: Reply with quote

Quote:

Hi I just want to know whether we can do the whole sequence in rexx..... Because i need the same process to find the no. of records for various files(around 10)

maheshwaran,

Read THIS topic once again from the beginning and you will find the answer yourself.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Dec 19, 2005 2:18 am    Post subject: Reply with quote

maheshwaran,

If the input files are huge and cannot be opened in View / Edit mode, then you can probably CALL SORT - repeatedly (in a loop) from your REXX program or prepare a Synctool / Icetool code which can handle all input files and invoke it from your rexx.

Thanks,
Phantom
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 -> TSO and ISPF 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