Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query on MAX function in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Fri Aug 03, 2007 5:04 pm    Post subject: Query on MAX function in SORT
Reply with quote

Hi,

We have a sorted report in which we have to perfom two functions,

1) pick up the maximum timestamp
2) Get the total number of records

For this we used the OUTFIL and MAX in the following format

Code:

  SORT FIELDS=(1,10,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,10,
      TRAILER3=(1,10,
          MAX=(1,10,CH,TO=CH,LENGTH=10)))


it is giving syntax error, anybody has previously used it or have idea about usong it.

Can any body suggest on this?

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

sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Fri Aug 03, 2007 5:21 pm    Post subject:
Reply with quote

Hi

This will give you the count.

Code:

    OPTION COPY
    OUTFIL REMOVECC,NODETAIL,
         TRAILER1=(COUNT=(M11,LENGTH=12))


i m working on other , if got i will post it.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Aug 03, 2007 5:22 pm    Post subject:
Reply with quote

ksk
Show the SPOOL messages,
Also check this link for example,
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg20/2.6.8.3?ACTION=MATCHES&REQUEST=max&SHELF=ICE1SH20.bks&DT=20060615173822&TYPE=FUZZY&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 03, 2007 8:31 pm    Post subject:
Reply with quote

ksk,

When I run your job with DFSORT, I get:

Code:

                   MAX=(1,10,CH,TO=CH,LENGTH=10)))
                             $                     
ICE223A 0 REPORT FIELD ERROR                       


You can't use CH format in MAX. You need to use a numeric format like ZD. This works:

Code:

    MAX=(1,10,ZD,TO=ZD,LENGTH=10)))

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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am
No new posts How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us