Page 1 of 1

Count the number of records from the input file

PostPosted: Tue May 29, 2012 4:35 pm
by jvinoth
Hi,
I need to count the number of records from the input file using sort.I have used the below sort card in the jcl and it works fine.
but i need to change the result into Zoned decimal please tel me how to do it.
SORT FIELDS=COPY                                     
   OUTFIL REMOVECC,NODETAIL,                         
   TRAILER1=('NO OF RECORDS: ',COUNT=(M11,LENGTH=8))
 
and the output

=COLS> ----+----1----+----2----+----
****** *****************************
000001 NO OF RECORDS: 00000029     
****** ****************************


Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 4:39 pm
by BillyBoyo
It is in Zoned Decimal. Unsigned.

Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 5:08 pm
by jvinoth
jvinoth wrote:Hi,
I need to count the number of records from the input file using sort.I have used the below sort card in the jcl and it works fine.
but i need to change the result into packed decimal please tel me how to do it.
SORT FIELDS=COPY                                     
   OUTFIL REMOVECC,NODETAIL,                         
   TRAILER1=('NO OF RECORDS: ',COUNT=(M11,LENGTH=8))
 
and the output

=COLS> ----+----1----+----2----+----
****** *****************************
000001 NO OF RECORDS: 00000029     
****** ****************************


Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 6:54 pm
by BillyBoyo
Have a look at the manual for TRAILER1, COUNT and see if it allows TO=PD,LENGTH=whatyou want

Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 7:14 pm
by jvinoth
i tried this but getting syntax error

TRAILER1=(3:COUNT=(M11,LENGTH=8),ZD,TO=PD)


Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 9:10 pm
by dick scherrer
Hello,

Is there some reason you did not post the complete error messsage (including the message id)?

Re: Count the number of records from the input file

PostPosted: Tue May 29, 2012 10:13 pm
by skolusu
Jvinoth,

Make up your mind. In one post you say zoned decimal and another you say Packed decimal. You just cannot make up your syntax and complain that it is not working.

Assuming you want packed decimal format, use the following DFSORT control cards.
//SYSIN    DD *                                     
  OPTION COPY                                       
  OUTFIL REMOVECC,NODETAIL,                         
  TRAILER1=('NO OF RECORDS: ',COUNT=(PD,LENGTH=8)) 
//*