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
 
help needed for sort

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

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Tue Nov 10, 2009 8:07 pm    Post subject: help needed for sort
Reply with quote

Below is the sort step that I have

Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD DSN=input file,DISP=SHR
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)         
//OUT      DD SYSOUT=*
//TOOLIN   DD *                                                   
  SORT FROM(IN) USING(CTL1)                                       
  SORT FROM(T1) USING(CTL2)                                       
//CTL1CNTL DD *                                                   
  OPTION EQUALS                                                   
  SORT FIELDS=(02,11,CH,A,      $ P-NUM                         
               13,08,CH,A,      $ PTM-NUM                     
               38,4,CH,A,       $ P_YEAR                   
               48,3,CH,A)       $ CP1                     
                                                                   
  SUM FIELDS=(63,15,ZD)         $ DPRICE                     
                                                                   
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(78:16C'0')),                   
  IFTHEN=(WHEN=(48,3,SS,EQ,C'513,523'),OVERLAY=(78:63,15,93:C'1')),
  IFTHEN=(WHEN=(48,3,CH,EQ,C'697'),OVERLAY=(78:23C'0'))           

  OUTFIL FNAMES=T1,REMOVECC,BUILD=(1,92,8C'0',101:X),             
  SECTIONS=(02,19,SKIP=0L,38,4,SKIP=0L,                           
  TRAILER3=(1,47,C'697',51,27,                                     
            78:TOT=(78,15,ZD,ZDC,LENGTH=15),                       
            93:TOT=(93,1,ZD,ZD,LENGTH=8),'T'))                     
//*                                                               
//CTL2CNTL DD *                                                   
  OMIT COND=(93,8,ZD,EQ,0,AND,101,1,CH,EQ,C'T')                   
  OPTION EQUALS                                                   
  SORT FIELDS=(02,11,CH,A,      $ P_NUM                         
               13,08,CH,A,      $ PTM-NUM                     
               38,4,CH,A,       $ P-YEAR                   
               48,3,CH,A)       $ CP1                     
  SUM FIELDS=(78,15,ZD,         $ DPRICE                     
              93,08,ZD)         $ DPRICE                     
  OUTFIL FNAMES=OUT,IFOUTLEN=77,                                   
  IFTHEN=(WHEN=(48,3,CH,EQ,C'697',AND,93,8,ZD,GT,0),               
  OVERLAY=(63:78,15,ZD,ZDC,LENGTH=15))                             
//*



INPUT

Code:

C1234567        0001  000029 7302 01 2011 2010N513 C000000000{00000000058428D
C1234567        0001  000028 7302 01 2011 2010N513 C000000000{00000000393743E
C1234567        0001  000031 7302 01 2011 2010N513 C000000000{00000000081949G
C1234567        0001  000032 7302 01 2011 2010N513 C000000000{00000000447853A
C1234567        0001  000026 7302 01 2011 2010N513 C000000000{00000000425543B
C1234567        0001  000030 7302 01 2011 2010N513 C000000000{00000000409748F
C1234567        0001  000033 7302 01 2011 2010N513 C000000000{00000000089570E
C1234567        0001  000027 7302 01 2011 2010N513 C000000000{00000000085108G
C1234567        0001  000000 7050 01 2011 2010N513 C000000000{00000067758673G
C1234567        0001  000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567        0001  000030 7302 01 2011 2010N603 C000015200{00000000000000{
C1234567        0001  000029 7302 01 2011 2010N603 C000003120{00000000000000{
C1234567        0001  000032 7302 01 2011 2010N603 C000019700{00000000000000{
C1234567        0001  000028 7302 01 2011 2010N603 C000014700{00000000000000{
C1234567        0001  000033 7302 01 2011 2010N603 C000004220{00000000000000{
C1234567        0001  000026 7302 01 2011 2010N603 C000015500{00000000000000{
C1234567        0001  000027 7302 01 2011 2010N603 C000003340{00000000000000{
C1234567        0001  000026 7302 01 2011 2010N696 C000000000{00000000425543B
C1234567        0001  000000 7050 01 2011 2010N696 C000000000{00000067758673G
C1234567        0001  000033 7302 01 2011 2010N696 C000000000{00000000089570E
C1234567        0001  000030 7302 01 2011 2010N696 C000000000{00000000409748F
C1234567        0001  000032 7302 01 2011 2010N696 C000000000{00000000447853A
C1234567        0001  000028 7302 01 2011 2010N696 C000000000{00000000393743E
C1234567        0001  000029 7302 01 2011 2010N696 C000000000{00000000058428D
C1234567        0001  000027 7302 01 2011 2010N696 C000000000{00000000085108G
C1234567        0001  000031 7302 01 2011 2010N696 C000000000{00000000081949G
C1234567        0001  000032 7302 01 2011 2010N697 C000000000{00000000447853A
C1234567        0001  000033 7302 01 2011 2010N697 C000000000{00000000089570E
C1234567        0001  000031 7302 01 2011 2010N697 C000000000{00000000081949G
C1234567        0001  000030 7302 01 2011 2010N697 C000000000{00000000409748F
C1234567        0001  000029 7302 01 2011 2010N697 C000000000{00000000058428D
C1234567        0001  000028 7302 01 2011 2010N697 C000000000{00000000393743E
C1234567        0001  000027 7302 01 2011 2010N697 C000000000{00000000085108G
C1234567        0001  000026 7302 01 2011 2010N697 C000000000{00000000425543B
C1234567        0001  000000 7050 01 2011 2010N697 C000000000{00000067758673G
C1234567        0001  000000 7050 01 2011 2011N615 C000053270{00000000000000{



CURRENT OUTPUT

Code:
C1234567        0001  000029 7302 01 2011 2010N513 C000000000{00000069750619D  - added of all 513 values
C1234567        0001  000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567        0001  000000 7050 01 2011 2011N615 C000053270{00000000000000{
C1234567        0001  000026 7302 01 2011 2010N696 C000000000{00000069750619D  - 513 values assigning here
C1234567        0001  000032 7302 01 2011 2010N697 C000000000{00000069750619D
- 513 + 523(if exists) values assigning here


EXPECTED OUTPUT (all 603 values (from column 48,3)should be displayed like input file)

Code:
C1234567        0001  000029 7302 01 2011 2010N513 C000000000{00000069750619D
C1234567        0001  000031 7302 01 2011 2010N603 C000003300{00000000000000{
C1234567        0001  000030 7302 01 2011 2010N603 C000015200{00000000000000{
C1234567        0001  000029 7302 01 2011 2010N603 C000003120{00000000000000{
C1234567        0001  000032 7302 01 2011 2010N603 C000019700{00000000000000{
C1234567        0001  000028 7302 01 2011 2010N603 C000014700{00000000000000{
C1234567        0001  000033 7302 01 2011 2010N603 C000004220{00000000000000{
C1234567        0001  000026 7302 01 2011 2010N603 C000015500{00000000000000{
C1234567        0001  000027 7302 01 2011 2010N603 C000003340{00000000000000{
C1234567        0001  000000 7050 01 2011 2011N615 C000053270{00000000000000{
C1234567        0001  000026 7302 01 2011 2010N696 C000000000{00000069750619D
C1234567        0001  000032 7302 01 2011 2010N697 C000000000{00000069750619D



I need the output with all 603 values and added of all 513 values(as it is)
currently it is displaying only one 603 values.

like 603,i have 200,215,225 ,350, all needs to work like 603.

513 only should added and remaining should go like input file.

Thanks
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: Wed Nov 11, 2009 3:12 am    Post subject:
Reply with quote

Showing what you did that didn't work doesn't really tell us what it is you want to do.

Please explain clearly the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
services

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Wed Nov 11, 2009 8:53 pm    Post subject: Reply to: help needed for sort
Reply with quote

thanks, i am skipping this sort and function from my jcl ,
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: Wed Nov 11, 2009 11:30 pm    Post subject:
Reply with quote

Quote:
thanks, i am skipping this sort and function from my jcl ,


I have no idea what that means.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Nov 12, 2009 3:52 am    Post subject:
Reply with quote

Hi,

Quote:
thanks, i am skipping this sort and function from my jcl ,
Is this another way of saying "Thanks, but no thanks" icon_lol.gif


Gerry
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: Thu Nov 12, 2009 4:05 am    Post subject:
Reply with quote

Ok, but it would be an odd way of saying that. I wonder what he decided to do instead.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 12, 2009 4:33 am    Post subject: Reply to: help needed for sort
Reply with quote

Quote:
I wonder what he decided to do instead.
Change/eliminate the business requirement. . . icon_neutral.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 12, 2009 5:25 am    Post subject: Reply to: help needed for sort
Reply with quote

services,

I just took a look at this topic and I had to say you have uncanny knack of complicating a simple request. You show an example of a job which has no relation with the current request.

From what I understood is that all you need to just sum up ONLY the records which have 513,696,697 at pos 48 and leave the other keys as is

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=your input FB 77 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  OPTION EQUALS,NZDPRINT                                         
  INREC IFTHEN=(WHEN=(48,3,SS,EQ,C'513,696,697'),OVERLAY=(78:8X)),
  IFTHEN=(WHEN=NONE,OVERLAY=(78:SEQNUM,8,ZD))       
             
  SORT FIELDS=(02,11,CH,A,      $ PROP-NUM                       
               13,08,CH,A,      $ PPTS-ITM-NUM                   
               38,4,CH,A,       $ PROPOSAL-YEAR                   
               48,3,CH,A,       $ COST-POOL1-3                   
               78,8,CH,A)       $ TEMP IND                       
                                                                 
  SUM FIELDS=(63,15,ZD)         $ DOLLARS-COST                   
                                                                 
  OUTREC BUILD=(1,77)                                             
//*
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: Thu Nov 12, 2009 5:28 am    Post subject:
Reply with quote

Kolusu,

Those mind reading classes you're taking are really paying off. (Well, I guess you knew I was going to say that.) icon_wink.gif
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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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