IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COUNT in SORT jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Thu Mar 13, 2014 4:32 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 13, 2014 4:50 pm
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: 92
Location: Pune

PostPosted: Thu Mar 13, 2014 4:53 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Thu Mar 13, 2014 5:22 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 13, 2014 5:23 pm
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: 1787
Location: Bloomington, IL

PostPosted: Thu Mar 13, 2014 5:25 pm
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: 92
Location: Pune

PostPosted: Thu Mar 13, 2014 5:31 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 13, 2014 7:36 pm
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: 92
Location: Pune

PostPosted: Fri Mar 14, 2014 11:55 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Fri Mar 14, 2014 12:17 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 14, 2014 12:18 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 14, 2014 4:43 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 1
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top