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

Is it possible through SYNCSORT


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

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Thu Feb 23, 2006 11:27 pm
Reply with quote

hi i have a file-1 saying
aa1 3
aa1--4
aa1--3
aa2--5
aa2--5
aa2--5
aa3--1
aa3--2

now I want a file saying

aa1--10
aa2--15
aa3--3

and then a trailer record saying total count = 28

is it possible thru dfsort
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Thu Feb 23, 2006 11:50 pm
Reply with quote

hi vijaya

you can try this...

Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
aa1             3
aa1             4
aa1             3
aa2             5
aa2             5
aa2             5
aa3             1   
aa3             2 
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  SORT FIELDS=(1,1,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,1,
      TRAILER3=(1,1,13:TOT=(13,6,FS,EDIT=(IIIIIT))))


Please check the position at your end
thanks
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: Thu Feb 23, 2006 11:57 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                                   
//SYSOUT    DD  SYSOUT=*                                   
//SORTIN DD *                                             
aa1--3                                                     
aa1--4                                                     
aa1--3                                                     
aa2--5                                                     
aa2--5                                                     
aa2--5                                                     
aa3--1                                                     
aa3--2                                                     
/*
//SORTOUT DD SYSOUT=*                                     
//SYSIN    DD    *                                         
  SORT FIELDS=(1,3,CH,A)                                   
  OUTFIL REMOVECC,NODETAIL,                               
    SECTIONS=(1,3,                                         
      TRAILER3=(1,5,TOT=(6,1,ZD,EDIT=(IT)))),             
    TRAILER1=('total count = ',TOT=(6,1,ZD,EDIT=(IT)))     
/*


SORTOUT will have:

Code:

aa1--10             
aa2--15             
aa3-- 3             
total count = 28   
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 4:54 am
Reply with quote

thanks for the soloution

just have another question

I have two coloumns


aa1- -- 3 75
aa1---- 3 75
aa2-------1 150
aa2-------4 150


My output should be

aa1 6 150
aa2 5 300
-------------------------------
totals 11 450


U Have told me to work with one column count.could u give me the syntax for multiple column count
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 Feb 24, 2006 5:09 am
Reply with quote

Here's a DFSORT job for that:

Code:

//S2    EXEC  PGM=ICEMAN                                 
//SYSOUT    DD  SYSOUT=*                                 
//SORTIN DD *                                           
aa1- --   3                  75                         
aa1----   3                  75                         
aa2-------1                 150                         
aa2-------4                 150                         
//SORTOUT DD SYSOUT=*                                   
//SYSIN    DD    *                                       
  SORT FIELDS=(1,3,CH,A)                                 
  OUTFIL REMOVECC,NODETAIL,                             
    SECTIONS=(1,3,                                       
      TRAILER3=(1,3,10:TOT=(11,1,FS,EDIT=(IT)),         
        29:TOT=(29,3,FS,EDIT=(IIT)))),                   
*   TRAILER1=('-------------------------------           
    TRAILER1=(31C'-',/,                                 
              'totals ',10:TOT=(11,1,FS,EDIT=(IT)),     
        29:TOT=(29,3,FS,EDIT=(IIT)))                     
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 5:45 am
Reply with quote

Thanks Sir ,

Just encountered a problem ..
If I have my data as 150.000 AND 75.00 what should the data type be in the syntax Could u tell me also what the type FS IS.
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 Feb 24, 2006 5:52 am
Reply with quote

Quote:
Could u tell me also what the type FS IS.


FS is floating leading sign (e.g. C'+123', C' -5', C' 27'). For a description of all of the DFSORT formats, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/C.0?DT=20050222160456

Quote:
If I have my data as 150.000 AND 75.00 what should the data type be in the syntax


You need to show me what your input data really looks like and what you want for output. Do you really have mixed 3 decimal and 2 decimal values? If so, are the decimal points in the same position in each record?

Please use ubb code tags around the data so we can see what it really looks like. If you don't know how to use ubb code tags, then use a b for each blank in the data.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 7:19 am
Reply with quote

the i/p file is

Code:

aa1    1         75.00
aa1    2         75.00
aa2    1        150.00
aa3    3        150.00
aa4    1        225.00
aa4    1        225.00


My o/p report should be like this

Code:

plan-code         count              cost/plan             total/cost
aa1               0000003                75.00            0000075.000
aa2               0000001               150.00            0000150.000
aa3               0000002               225.00            0000150.000
aa4               0000001               225.00            0000450.000
--------------------------------------------------------------------------------
Totals  :         0000007                                 0000825.000
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 Feb 24, 2006 9:30 pm
Reply with quote

Well, your numbers don't add up, so it's hard to tell what the amounts represent (e.g. you have one aa3 record with 3 and 150.00 for input, but you show a count of 2 for output and a cost/plan that doesn't make any sense). However, I'll take a shot and assume that count is the total of the first amount for each key, cost/plan is the average of the second amount for each key and total/cost is the total of the second amount for each key. Given that, here's a DFSORT job that will give you the kind of report I think you're asking for.

Code:

//S1    EXEC  PGM=ICEMAN                                             
//SYSOUT    DD  SYSOUT=*                                             
//SORTIN DD *                                                         
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
aa1    1         75.00                                               
aa1    2         75.00                                               
aa2    1        150.00                                               
aa3    3        150.00                                               
aa4    1        225.00                                               
aa4    1        225.00                                               
//SORTOUT DD SYSOUT=*                                                 
//SYSIN    DD    *                                                   
  SORT FIELDS=(1,3,CH,A)                                             
  OUTFIL REMOVECC,NODETAIL,                                           
    HEADER2=('plan-code',19:'count',38:'cost/plan',60:'total/cost'), 
    SECTIONS=(1,3,                                                   
      TRAILER3=(1,3,                                                 
         19:TOT=(7,2,FS,EDIT=(TTTTTTT)),                             
         38:AVG=(15,8,UFF,EDIT=(IIIIIT.TT)),                         
         59:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')),                 
    TRAILER1=(80'-',/,'Totals  :',                                   
         19:TOT=(7,2,FS,EDIT=(TTTTTTT)),                             
         59:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')                   


SORTOUT will have:

Code:

plan-code         count              cost/plan             total/cost
aa1               0000003                75.00            0000150.000
aa2               0000001               150.00            0000150.000
aa3               0000003               150.00            0000150.000
aa4               0000002               225.00            0000450.000
----------------------------------------------------------------------
Totals  :         0000009                                 0000900.000
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 10:36 pm
Reply with quote

Sir,

I have attached an textpad giving of how eaxctly my report should look.
Could u help me out.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 11:49 pm
Reply with quote

I have tried the synatx but I ma getting a u0016 error

could u help me please
TRAILER3=(23,5,
59:TOT=(7,2,FS,EDIT=(TTTTTTT)),
121:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0',
*
152:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')),
TRAILER1=(80'-' ,/,'TOTALS :' ,
59:TOT=(7,2,FS,EDIT=(TTTTTTT)),
*
121:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0',
*
152:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')
*
the * indicate where the error is
The plan count column starts from 59 ,the total-profit-amt column starts from 124 and the total-liability column from 152..

*
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Fri Feb 24, 2006 11:50 pm
Reply with quote

Quote:
59:TOT=(7,2,FS,EDIT=(TTTTTTT)),
121:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0',
*
152:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')),
TRAILER1=(80'-' ,/,'TOTALS :' ,
59:TOT=(7,2,FS,EDIT=(TTTTTTT)),
*
121:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0',
*
152:TOT=(15,8,UFF,EDIT=(TTTTTTT.TT)),C'0')
*
the * indicate where the error is
The plan count column starts from 59 ,the total-profit-amt column starts from 124 and the total-liability column from 152..

*
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 Feb 24, 2006 11:55 pm
Reply with quote

Please show the error message you received.
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Feb 25, 2006 12:07 am
Reply with quote

sir[img][/img]
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Feb 25, 2006 12:09 am
Reply with quote

Sir i ma attaching the word doc which contains the screenshot
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Feb 25, 2006 12:10 am
Reply with quote

Sir i ma attaching the word doc which contains the screenshot
Back to top
View user's profile Send private message
vijayamadhuri

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Sat Feb 25, 2006 1:48 am
Reply with quote

hello sir

The data format for the column total-profit-amt and total-liability is
9(9).99 .IF that helps.
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: Sat Feb 25, 2006 1:49 am
Reply with quote

The WER messages indicate you're using Syncsort, not DFSORT. DFSORT supports UFF. Syncsort does not support UFF, so you can't use the technique I showed with Syncsort as you could with DFSORT.

Note that I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Feb 25, 2006 1:57 am
Reply with quote

Superk - moved topic to the JCL Forum and changed the title to "Is it possible through SYNCSORT".
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 Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top