View previous topic :: View next topic |
Author |
Message |
mcshastry Beginner
Joined: 24 Nov 2005 Posts: 4 Topics: 4
|
Posted: Tue Nov 29, 2005 1:17 am Post subject: How can I find out the number of records in a flat file? |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Tue Nov 29, 2005 1:59 am Post subject: |
|
|
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 |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Tue Nov 29, 2005 5:01 am Post subject: |
|
|
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 |
|
 |
Samuel Beginner
Joined: 12 Aug 2004 Posts: 38 Topics: 10
|
Posted: Tue Nov 29, 2005 11:34 am Post subject: |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Dec 06, 2005 8:29 am Post subject: |
|
|
A "Flat File", as in a file that has no vertical depth, would contain no more than 1 physical record. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Dec 06, 2005 9:21 am Post subject: |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Dec 06, 2005 10:29 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Dec 06, 2005 12:29 pm Post subject: |
|
|
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 |
|
 |
maheshwaran Beginner
Joined: 17 Dec 2005 Posts: 1 Topics: 0 Location: Chennai
|
Posted: Sat Dec 17, 2005 7:06 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Dec 17, 2005 9:33 am Post subject: |
|
|
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 |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Mon Dec 19, 2005 2:18 am Post subject: |
|
|
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 |
|
 |
|
|