View previous topic :: View next topic
|
Author |
Message |
amar143
New User
Joined: 11 Nov 2010 Posts: 4 Location: India
|
|
|
|
Hi,
My input file have records as shown below:
I want to add count and price for same SRNO and CDE.
SRNO -- length 6 bytes
CDE -- lenght 2 bytes
COUNT -- length 1 byte
PRICE -- length 4 bytes
Input file:
SRNO CDE COUNT PRICE
100001 10 2 1000
100001 10 2 1000
100001 20 4 3000
100001 20 2 1000
100002 20 2 5000
100002 20 2 1000
Output should be
100001 10 4 2000
100001 20 6 4000
100002 10 4 6000
can we achieve above addition of fields through JCL?
Thanks in advance for yor help!! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
can we achieve above addition of fields through JCL? |
No. JCL does not do data manipulation - it lets the OS know that you want to run a program and the resources required.
Also, please use the term 'data set' not 'file' - these are different things.
Another also, please use the code tags when presenting data and code and anything else requiring a fixed font.
Finally, have you looked at SUM? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
for the average user hanging around
Anything not written in COBOL by the organisation they work for is classified as JCL
so trying to make them learn is a waste of time
quoting Bruce Schneier
Quote: |
Anyone who says that the solution is to educate the users has never met an actual user. |
|
|
Back to top |
|
|
amar143
New User
Joined: 11 Nov 2010 Posts: 4 Location: India
|
|
|
|
Thanks all for your help |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Assuming the record is already sorted(1,9)
Code: |
//STEP01 EXEC PGM=SORT
//SORTIN DD *
100001 10 2 1000
100001 10 2 1000
100001 20 4 3000
100001 20 2 1000
100002 20 2 5000
100002 20 2 1000
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
//SYSIN DD *
OPTION COPY
OUTFIL NODETAIL,REMOVECC,
SECTIONS=(1,09,
TRAILER3=(1,10,
TOT=(11,1,ZD,ZD,LENGTH=1),X,
TOT=(13,4,ZD,ZD,LENGTH=4)))
|
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2024 Location: USA
|
|
|
|
magesh23586 wrote: |
Assuming the record is already sorted(1,9) |
I believe, it's not good idea just to give ready solutions to the people who do not understand even the difference between JCL, utilities, COBOL, REXX, zOS, ... and everything else.
In this way we increase the number of dummy computer gamers in place of computer professionals. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
I concur, the beginners forum then should be of no use. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
the beginners forum then should be of no use. |
unless there is a grammatical error in this quote the Beginners Forum should be MORE relevant. Topics like this shold be redirected there. Just because you are an ace in one area of mainframe does not give you a right to post ALL your queries in the Experts Forum. I posted all my srt queries in the Beginners Forum because, no matter how good I was at JCL, PL/1, Rexx etc, I was a dummy at DFSort. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
That's right. But if no one is aware and making efforts to post over beginners forum that's where I question if its use.
But this instance have been discussed in past too but I don't recall any concrete solution derived ..
I mean , it's all right to give solutions right alway if a little efforts are seen from the TS otherwise no one would ever learn except us😊 |
|
Back to top |
|
|
|