Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COUNT in SORT jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Thu Mar 13, 2014 4:32 pm    Post subject: COUNT in SORT jcl
Reply with quote

Hi,

I am using the below to get the count -

OPTION COPY
OUTFIL TRAILER1=(1:'CCCREJR',8:'|',9:COUNT=(M11,LENGTH=8)),
REMOVECC,NODETAIL

I am getting the output as -
CCREJR|00000025

Now I want the output of sort as -

CCREJR|25

i.e. without leading zeroes. If i am removing M11, it gives me 6 spaces followed by 25 which I don't need.

Thanks.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Thu Mar 13, 2014 4:50 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

25 is still 25 no matter how many leading zeros. There is an example here, if I remember correctly, but it is overkill for something which does not matter.
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Thu Mar 13, 2014 4:53 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

But it matters to the person who reads input file through program. It doesn't accept leading spaces or zeroes.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Mar 13, 2014 5:22 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

very little flexibility around there ...

even the most stupid program can read and understand a number with leading zeros icon_cool.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Thu Mar 13, 2014 5:23 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Well, that's funny, but look at this for such a task if the receiver continues to keep a straight face.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Mar 13, 2014 5:25 pm    Post subject: Re: Reply to: COUNT in SORT jcl
Reply with quote

kishpra wrote:
But it matters to the person who reads input file through program. It doesn't accept leading spaces or zeroes.

Master of the Universe! The "programmer" who wrote that input routine would have had to go out of his way to write such a piece of slop. Perhaps that program should be modified instead.
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Thu Mar 13, 2014 5:31 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Please assist on any change that can be done in the sort card to remove leading zeroes or spaces from COUNT
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 13, 2014 5:42 pm    Post subject: Re: Reply to: COUNT in SORT jcl
Reply with quote

kishpra wrote:
Please assist on any change that can be done in the sort card to remove leading zeroes or spaces from COUNT


not only do people not read manuals or search for existing solutions,
but they do not even look at suggestions provided.

Kishpra,

look at Bill Woodger's last post. He provided a direct link to the solution.
Even though it says Syncsort, the sort cards provided also work w/DFSORT.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Thu Mar 13, 2014 7:36 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work.
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Fri Mar 14, 2014 11:55 am    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Thanks for the reply.

it is not working for me as -

OUTFIL TRAILER1=(1:'CCCREJR',8:'|',9:COUNT=(LENGTH=8),SQZ=(SHIFT=LEFT)),
REMOVECC,NODETAIL

it is giving me error.

Pelase assist.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Mar 14, 2014 12:17 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

would it be a problem for You to tell what DOES NOT WORK and the error You receive ???. icon_evil.gif
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Fri Mar 14, 2014 12:18 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Well, you changed it. Please look at the original example. Other than there being two counts, it is the same requirement as yours. So you can't just take some of the code from one place and put it in another, more convenient, place. Arun would have thought of that originally. The reason he wrote that code is because you can't, at all, do what you just tried.

Re-read the link. Re-code. Remember that I noted you have to do it on each record. If that is true, how did you even think you could just add it to the TRAILER1?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7240

PostPosted: Fri Mar 14, 2014 4:43 pm    Post subject: Reply to: COUNT in SORT jcl
Reply with quote

Note also that it will be formatting the count for each input record. Means client paying for more CPU on the Mainframe, rather than the program that can't understand that 025 is the same as 25 is the same as 000000000000000025 being changed. Heck, even Excel understands it, you have to go out of your way to make it not work.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us