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
 

 

To get the Maxiumu value of a field Using Syncsort

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

New User


Joined: 18 Aug 2006
Posts: 43

PostPosted: Thu Apr 17, 2008 3:41 pm    Post subject: To get the Maxiumu value of a field Using Syncsort
Reply with quote

Hi All,
I have an input file with 50 numeric fields.I need to get the maximum values of these fields and write it on to a report.I tried using OUTREC statement but i am getting Numeric field error.Can anyone help me out how to achieve this using OUTREC statment.I want particularly using DFSORT.

regards
Akshatha
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 6:17 pm    Post subject: Re: To get the Maxiumu value of a field Using DFSORT
Reply with quote

akshathan wrote:
I tried using OUTREC statement but i am getting Numeric field error.Can anyone help me out how to achieve this using OUTREC statment.
And you want us to guess how an outrec should look like without any idea of what the input looks like? icon_rolleyes.gif

Post you JCL.
Post your sysouts.
Post an example of what your input looks like.
Post what you want your output to look like.

And a sort on the field descending with a stop after one will get you what you want....unless you have a non-numeric field..... icon_lol.gif
Back to top
View user's profile Send private message
akshathan

New User


Joined: 18 Aug 2006
Posts: 43

PostPosted: Fri Apr 18, 2008 9:52 am    Post subject: Reply to: To get the Maxiumu value of a field Using DFSORT
Reply with quote

Hi CICSGUY,

Sorry for not providing the details.The JCL which i am using is

Code:
 //TSORTJOB JOB (T,DH,POP),AKSHATHA,CLASS=S,MSGCLASS=0 
 //*+JBS BIND C301.UP                                   
//PS010    EXEC PGM=SORT
//*********************
//SYSOUT   DD SYSOUT=*
//SYSDUMP  DD SYSOUT=*
//SORTLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN   DD  DSN=B052A2N.NA.XBPR378.REPORT.G252,
//             DISP=SHR                           
//SORTOUT  DD  DSN=B052A2N.XBPR378.MAX.INFO,       
//             DISP=(NEW,CATLG,DELETE),             
//             UNIT=STOR,SPACE=(CYL,(200,300),RLSE),
//             VOL=(,,,99)                         
//SYSIN   DD *                                     
    OUTREC FIELDS=(4:C'MAX RPT-PRIN:',20:3,5,ZD,MAX)
/* 

The error details

Code:
SYNCSORT FOR Z/OS  1.2.2.3R    U.S. PATENTS: 4210961, 5117495   (C)2005
                                       FEDERATED SYSTEMS GROUP   z/OS   
PRODUCT LICENSED FOR CPU SERIAL NUMBER 2ED8F, MODEL 2084 304           
SYSIN :                                                                 
    OUTREC FIELDS=(4:C'MAX RPT-PRIN:',20:3,5,ZD,MAX)                   
                                                *                       
WER271A  OUTREC STATEMENT  : NUMERIC FIELD ERROR                       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE               

My requirement is, I have around 100 fields in an input file and i have to find the maximum of all the fields and iwrite it on to an output file using SORT utility(Outrec statement) in a single step.Please help me out.
Back to top
View user's profile Send private message
akshathan

New User


Joined: 18 Aug 2006
Posts: 43

PostPosted: Fri Apr 18, 2008 10:00 am    Post subject: Reply to: To get the Maxiumu value of a field Using DFSORT
Reply with quote

Hi CICGUY,
I just missed to mention the input i am using.The Input file looks like below
Code:
01000000000000000000000000000000000TOTAL COMPANY       
01000010000000000000000000000000000PRIN: 1 RTW         
01000010000100000000000000000000000GFOB: 1 MS & WMN SPO


The initial numeric values i will be using to get the Maximum value.

I want the Output file in the following format
Code:
MAX RPT-PRIN:9999
MAX RPT-FOB:9789

.
.
.
.
.
.
and so on.
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 Apr 18, 2008 11:21 pm    Post subject:
Reply with quote

The WER messages indicate you're using Syncsort, not DFSORT. I've changed your Subject line and moved this thread to the JCL Forum.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 11:56 pm    Post subject:
Reply with quote

I can't test it out, but the manual seems to imply that the outrec should look more like this:
OUTREC FIELDS=(4:C'MAX RPT-PRIN:',20:MAX=(3,5,ZD))

But I don't see how your JCL will produce multiple MAXes.....
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Sat Apr 19, 2008 8:12 pm    Post subject: Reply to: To get the Maxiumu value of a field Using Syncsort
Reply with quote

STATS Operator of ICETOOL is useful if you want such type of statistics. Just find out its syntax. It is quite simple


-Ajay
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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