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

To get the Maxiumu value of a field Using Syncsort


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

New User


Joined: 18 Aug 2006
Posts: 45

PostPosted: Thu Apr 17, 2008 3:41 pm
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: 2146
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 6:17 pm
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: 45

PostPosted: Fri Apr 18, 2008 9:52 am
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: 45

PostPosted: Fri Apr 18, 2008 10:00 am
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 Developer


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

PostPosted: Fri Apr 18, 2008 11:21 pm
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: 2146
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 11:56 pm
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: 206
Location: Bangalore

PostPosted: Sat Apr 19, 2008 8:12 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
Search our Forums:

Back to Top