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 

Syncsort total

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


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Fri Apr 09, 2004 9:57 am    Post subject: Syncsort total Reply with quote

Code:

//Step1    EXEC PGM=SORT                               
//SORTIN   DD DSN=(MYINPUT FILE),DISP=SHR 
//*                                                     
//SORTOUT  DD DSN=(OUTPUT FILE),
//            DISP=(NEW,CATLG,DELETE),LRECL=15                           
//            SPACE=(15,(100,20),RLSE),AVGREC=K
//*                                                     
//SYSIN    DD *                                         
         INREC FIELDS=(001:C'TOT :  ',                 
                       008:C'00000001')                 
         SORT FIELDS=(01,03,CH,A)                       
         SUM FIELDS=(8,8,ZD)                           
/*                                                     


If My input file is having zero records then
I would like see the output file as :

TOT : 00000000

Can anyone know if this can be done.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 09, 2004 5:52 pm    Post subject: Reply with quote

Sateesh,

Try this JCL

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=MYINPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1),RLSE),
//SYSIN    DD *
  SORT FIELDS=COPY                                         
  OUTFIL NODETAIL,REMOVECC,TRAILER1=('TOT:',8:COUNT,80:X) 
/*                                                         


Hope this helps...

Cheers

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


Joined: 23 Jan 2004
Posts: 40
Topics: 16
Location: Bangalore

PostPosted: Wed Apr 14, 2004 2:43 pm    Post subject: Reply with quote

Hi Kolusu,

This is giving OUTFIL syntax error ...

Thanks.
_________________
Regards,
Sateesh
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Apr 14, 2004 3:02 pm    Post subject: Reply with quote

Sateesh,

I guess that error is due to the REMOVECC parm. You need syncsort Z/os for that parm to work. It would be great if you can post the entire sysout message.

Since you have an old version of syncsort, you need two steps to get the desired result.

Code:

//*********************************************************************
//* THIS STEP WILL COUNT THE NO OF RECORDS IN A FILE                 **
//*********************************************************************
//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=MYINPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=&TEMP1,
//            DISP=(NEW,PASS),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1),RLSE),
//SYSIN    DD *
  SORT FIELDS=COPY                                         
  OUTFIL NODETAIL,TRAILER1=('TOT:',8:COUNT,80:X) 
//*
//*********************************************************************
//* THIS STEP WILL REMOVE THE CARRIAGE CONTROL CHARACTER FROM THE    **
//* ABOVE OUTPUT                                                     **
//*********************************************************************
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=&TEMP1,
//            DISP=OLD
//SORTOUT  DD DSN=OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,1),RLSE),
//            RECFM=FB
//SYSIN    DD *
  SORT FIELDS=COPY                                         
  OUTREC FIELDS=(2,80)
/*                                                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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