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
 

 

Is it possible through SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Is it possible through SYNCSORT
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    Post subject: Re: dfsort
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 Moderator


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

PostPosted: Thu Feb 23, 2006 11:57 pm    Post subject:
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    Post subject: Is it possible thru Dfsort
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 Moderator


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

PostPosted: Fri Feb 24, 2006 5:09 am    Post subject:
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    Post subject: Re: Is it possible thru Dfsort
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 Moderator


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

PostPosted: Fri Feb 24, 2006 5:52 am    Post subject:
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:

http://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    Post subject: Hello sir
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 Moderator


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

PostPosted: Fri Feb 24, 2006 9:30 pm    Post subject:
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    Post subject: Re: Is it possible thru Dfsort
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    Post subject: Sir
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    Post subject:
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 Moderator


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

PostPosted: Fri Feb 24, 2006 11:55 pm    Post subject:
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    Post subject:
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    Post subject: Re: Is it possible thru Dfsort
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    Post subject: Re: Is it possible thru Dfsort
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    Post subject:
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 Moderator


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

PostPosted: Sat Feb 25, 2006 1:49 am    Post subject:
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

Moderator Team Head


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

PostPosted: Sat Feb 25, 2006 1:57 am    Post subject: Re: Is it possible through SYNCSORT
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    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: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm


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