FILE FILEOUT FB(0 0)
FILEOUT-REC 01 LRECL A
TRAIL 01 15 A
COUNT 20 08 N 0
JOB INPUT FILEIN FINISH DISP-PROC
PUT FILEOUT FROM FILEIN
DISP-PROC. PROC
TRAIL = 'TOTAL RECORDS ='
COUNT = RECORD-COUNT
PUT FILEOUT
END-PROC
/*
If you are looking for a sort solution, then the following DFSORT/ICETOOL JCL will give you the desired results.You should have DFSORT PTF UQ99331 (March, 2002) installed for the following jcl to work as REMOVECC is a new feature introduced.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Jan 30, 2003 11:51 am Post subject:
Note that DFSORT's COUNT option gives you an 8-byte value with leading zeros suppressed. If you want the count in a different format, you can use DFSORT's COUNT=(edit) option where edit can be an edit mask (M0-M26) or the EDIT=(...) parameter. You can also use LENGTH=n. For example, if you wanted a 5-byte count with leading zeros suppressed, you could use:
Code:
TRAILER1=('TOTAL RECORDS = ',COUNT=(EDIT=(IIIIT)))
or
Code:
TRAILER1=('TOTAL RECORDS = ',COUNT=(M10,LENGTH=5))
COPY FROM(T1) TO(OUT) USING(CTL2)
SYNCSORT CALLED WITH IDENTIFIER "0002"
and this msg. in DFSMSG:
T1 : RECFM=VBA ; LRECL= 134; BLKSIZE= 27998
OUTREC RDW NOT INCLUDED
SYNCSMF CALLED BY SYNCSORT; RC=0000
and job is abending.
Yes I've syncsort at my shop.
And your EZTreive solution is working correctly to some extent but , in the output file , it is inserting Zeros (Sort of low values) after the actual data.
Joined: 26 Nov 2002 Posts: 12367 Topics: 75 Location: San Jose
Posted: Wed Feb 05, 2003 10:47 am Post subject:
Framework1,
Since your input file is vb file the report for the count will be created as VBA. In that case change CTL2CNTL to the following.
Code:
OUTREC FIELDS=(6,80),CONVERT
The easytrieve solution will have binary zeroes at the end after the count because you must have defined the output file to the length of the input file. But your interest is only to find the number of records in the file like this.
Code:
TOTAL RECORDS = 00000021
The total length of this record is only 28 bytes.
So if you create file with a lrecl of 133,so starting from 29 to 133 bytes you will have binary zeroes.so you either can create a 28 byte file or code a another field in the file declaration to initialize the rest of the bytes.
Code:
FILEOUT-REC 01 133 A
TRAIL 01 15 A
COUNT 20 08 N 0
FILLER 29 105 A
DISP-PROC. PROC
TRAIL = 'TOTAL RECORDS ='
COUNT = RECORD-COUNT
FILLER = ' '
PUT FILEOUT
END-PROC
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 27, 2003 3:31 pm Post subject:
Anand,
This works fine with DFSORT which supports COUNT=(M11,LENGTH=6). But Syncsort does NOT support COUNT=(edit). _________________ 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
Can u tell me how can I achieve the same using syncsort.. basically I want the M1 routine. which keeps the zeors in the count as it is.. and I want to remove the carriage control character also..
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 27, 2003 3:56 pm Post subject:
Anand,
REMOVECC to remove the carriage control and COUNT=(edit) are both supported by DFSORT, but not Syncsort. I'm the wrong person to ask how to do things with Syncsort since I'm a DFSORT developer (Syncsort is a competitive product). Maybe Kolusu can help you. _________________ 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
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