How to left Justify the record count in trailer record?

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
pjagathis
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Skillset: JCL,COBOL,SYNCSORT,SAS,DB2
Referer: Internet Browsing
Location: Chennai
Contact:

How to left Justify the record count in trailer record?

Postby pjagathis » Thu Dec 29, 2011 1:10 pm

Hi,

My requirement is to get record count alone in a flat file..

When i am using TRAILER2= Count, it giving count as right justified..

Please see the code

Code: Select all

//SORTIN   DD *                                     
  123                                               
  FDS                                               
  DER                                               
  234                                               
/*                                                   
//**                                                 
//CUNTFILE DD DSN=OUTPUT-FILE,                       
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                           
//            SPACE=(CYL,(5,5),RLSE),               
//            DCB=(RECFM=FB,LRECL=010,BLKSIZE=0)     
//**                                                 
//SYSIN    DD *                                     
**                                                   
  SORT FIELDS=COPY                                   
**                                                   
  OUTFIL FNAMES=CUNTFILE,REMOVECC,NODETAIL,         
**     TRAILER1=(1:COUNT=(M10,LENGTH=10))           
/*                                                   
//**                                                 



Output getting:

Code: Select all

        4


Required Output:

Code: Select all

4


Please help me ....

ThanX in advance...!
Thanks and Regards,
Jagathis P

User avatar
Nik22Dec
Posts: 68
Joined: Mon Dec 26, 2011 6:38 pm
Skillset: COBOL
JCL
DB2
SORT
DIRECTOR
FILE-AID
EXPEDITOR
Referer: Google

Re: How to left Justify the record count in trailer record?

Postby Nik22Dec » Thu Dec 29, 2011 3:02 pm

Hi,

I tried calculating the record count & removing the leading spaces in a single sort step but, couldn't succeed. Though, what I could achieve was to remove leading spaces in a separate step. Please refer to the sort given below.

Code: Select all

//S1    EXEC  PGM=SORT                 
//SYSOUT    DD  SYSOUT=*               
//SORTIN DD *                           
     1                                 
     3                                 
//SORTOUT DD SYSOUT=*                   
//SYSIN    DD    *                     
  SORT FIELDS=COPY                     
  INREC BUILD=(1,14,JFY=(SHIFT=LEFT))   
/*                                     

Hope it helps.

Thanks & Regards,
Nik
Thanks,
Nik

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: How to left Justify the record count in trailer record?

Postby BillyBoyo » Thu Dec 29, 2011 11:29 pm

pjagathis,

It is not easy to do what you want. Why do you want it left-justified? If the data is to be read by something external to the mainframe, why don't you take the zero-suppression off? 000000004 is the same as 4bbbbbbbbb for anything which wants to read that figure.

pjagathis
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Skillset: JCL,COBOL,SYNCSORT,SAS,DB2
Referer: Internet Browsing
Location: Chennai
Contact:

Re: How to left Justify the record count in trailer record?

Postby pjagathis » Fri Dec 30, 2011 2:20 pm

Hi Nik22Dec,

ThanX Nik22Dec...

I also tried this yesterday.. but i am trying to do in single sort step.... Or we can use any logic to get it done ???

Hi BillyBoyo,

ThanX...

But my requirement is to suppress the leading zeros and left justify the count... Let me try further.. i googled it for many times but i didn't get solution for this... we can do it 2 steps.. but i am trying to do in single step.. since i have to create count for more than 6 files.. so that i can reduce the step...

Thanx...
Thanks and Regards,
Jagathis P

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: How to left Justify the record count in trailer record?

Postby BillyBoyo » Fri Dec 30, 2011 2:26 pm

I understand that it is your requirement, but I don't understand why. What is the business necessity for it to be like that?

To show you the sort of thing it will take, look at this: http://ibmmainframes.com/about54238.html Scroll back two posts, and you'll see some code. I'd not like that sort of code included anywhere just to do that, unless there is a really, really, good reason.

pjagathis
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Skillset: JCL,COBOL,SYNCSORT,SAS,DB2
Referer: Internet Browsing
Location: Chennai
Contact:

Re: How to left Justify the record count in trailer record?

Postby pjagathis » Tue Jan 03, 2012 2:27 pm

Hi BillyBoyo,

As of now, I have delivered files with leading zeros...

ThannX for your help..!
Thanks and Regards,
Jagathis P

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: How to left Justify the record count in trailer record?

Postby BillyBoyo » Tue Jan 03, 2012 2:36 pm

Thanks for letting us know.

There is no reason I can think of that this should cause a problem to anyone trying to read those totals in any language. If you get complaints, explain the situation to your boss, show his the amount of code you'd need (and the example won't work for you directly, you'd need to work on it) and get them to sort it out.

pjagathis
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Skillset: JCL,COBOL,SYNCSORT,SAS,DB2
Referer: Internet Browsing
Location: Chennai
Contact:

Re: How to left Justify the record count in trailer record?

Postby pjagathis » Mon Jan 09, 2012 2:40 pm

Happy .. BillyBoyo!

Accepted the file with leading Zeros..

Have a Great day..!
Thanks and Regards,
Jagathis P

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: How to left Justify the record count in trailer record?

Postby BillyBoyo » Mon Jan 09, 2012 3:07 pm

I'm glad. Thanks for letting us know.

pjagathis
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Skillset: JCL,COBOL,SYNCSORT,SAS,DB2
Referer: Internet Browsing
Location: Chennai
Contact:

Re: How to left Justify the record count in trailer record?

Postby pjagathis » Tue Jan 10, 2012 7:09 pm

Code I have used..

Code: Select all

OUTFIL FNAMES=OTPTFIL,                     
           OUTREC=(1,80),REMOVECC,NODETAIL,     
         TRAILER1=(1:COUNT=(M11,LENGTH=10))     
Thanks and Regards,
Jagathis P


  • Similar Topics
    Replies
    Views
    Last post