View previous topic :: View next topic
|
Author |
Message |
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Hi,
the dataset contains the records in this format.
Code: |
00 978
01 683
02 442
03 274
04 255
05 235
06 296
07 471
08 1034
09 1571
10 2379
|
my output file should be like
Kindly let me know the tools to get this |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Kindly let us know which Sort product you use and why you can't find the manual. Look at the TRAILERn functions. |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
i need the exact code to get this ouput |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I agree. If your code is not exact, you can't expect it to work.
Quote: |
Kindly let me know the tools to get this |
To confirm the answer to your question: your Sort product can do this.
To give you a hint. Look at the TRAILER1 function. Has TOTAL and AVG. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Early on, you need to understand that the forum works best when you post sufficient information for someone to help you (what you believe is enough often is not).
You also need to provide the answers to requests for information. We do not ask just to entertain ourselves. The information requested is used to help you.
Quote: |
i need the exact code to get this ouput |
Yes, you surely do. (Re-read what Bill posted). And we will help you get to the "exact code". Our intention is to let you learn rather than doing the work for you. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Bill has given you indication, followed by Dick... Have you tried by writing some code using the SORT (product at your shop)? Did you get some error? Or faced some issue? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Unfortunately, this looks line another "newbie" who believes others should provide solutions so that learning is not really necessary . . .
d |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Code: |
//SYSIN DD *
OUTFIL REMOVECC,NODETAIL,
TRAILER1=((C'AVERAGE:',1:AVG=(07,03,ZD,M12))
/*
|
getting sysntax error |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you show us the error? Can't do much otherwise. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
getting sysntax error |
it would be nice if You would tell where
Quote: |
i need the exact code to get this ouput |
the TS wants us to provide it |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
At a guess, remove the "1:".
You seem to have forgotten any code for the total? |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Code: |
//STEP0006 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=G1OL00AT.QPRA.AFTR.MINU
//SORTOUT DD DSN=G1OL00AT.QPRA.AFTR.MINU.AVG,
// DISP=(OLD,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=50,BLKSIZE=27000)
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=SORTOUT,NODETAIL,
SECTIONS=(01,04,
TRAILER1=(C' AVG:',AVG=(81,08,ZD,EDIT=(TT.TT)))
/*
|
this is my code... pls tell me where i did wrong. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
nahh
it's the m12 that sucks
and since the numbers are integers the TS will have to do some mangling
and... since I am in a very good mood here is a snippet ...
Code: |
****** ***************************** Top of Data ******************************
000001 //ENRICO1 JOB (ACCT#),'SORT90',NOTIFY=ENRICO,
000002 // CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
000003 //* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
000004 //*
000005 //ICE EXEC PGM=SORT
000006 //SYSPRINT DD SYSOUT=*
000007 //SYSOUT DD SYSOUT=*
000008 //*4567890123456
000009 //SORTIN DD *
000010 01 1
000011 02 12
000012 03 123
000013 04 1234
000014 05 12345
000015 06 23456
000016 07 34567
000017 08 45678
000018 09 56789
000019 10 67890
000020 //SORTOUT DD SYSOUT=*
000021 //SYSIN DD *
000022 OPTION COPY
000023 INREC OVERLAY=(81:3,8,UFF,MUL,+100,M11,LENGTH=12)
000024 OUTFIL REMOVECC,NODETAIL,
000025 TRAILER1=('COUNT : ',COUNT=(M11,LENGTH=08),/,
000026 'SUM : ',TOT=(81,12,UFF,EDIT=(TTTTTTTT.TT)),/,
000027 'AVG : ',AVG=(81,12,UFF,EDIT=(TTTTTTTT.TT)))
****** **************************** Bottom of Data **************************** |
adjust the positions and length accordingly |
|
Back to top |
|
|
shanth555
New User
Joined: 17 Aug 2012 Posts: 35 Location: India
|
|
|
|
Thank You so Much Enrico
I would like to learn a lot from you... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I am afraid You might not learn too much about sort from me |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Good to hear it is working
When posting a problem like this one, you should post the JCL, control statements, and the diagnostics (including message numbers) generated by the run. |
|
Back to top |
|
|
|