View previous topic :: View next topic
|
Author |
Message |
sharana64
New User
Joined: 30 Dec 2017 Posts: 2 Location: USA
|
|
|
|
I have input file with below records,
Input File:
Code: |
CICSA 11/1/2017 1 16:45:18
CICSA 11/1/2017 2 16:45:18
CICSA 11/1/2017 10 16:45:18
CICSA 11/1/2017 12 16:45:18
CICSA 11/2/2017 13 19:00:00
CICSA 11/2/2017 14 19:00:00
CICSA 11/2/2017 65 19:00:00
CICSB 11/1/2017 13 16:45:18
CICSB 11/1/2017 14 16:45:18
CICSB 11/1/2017 65 16:45:18
CICSB 11/1/2017 13 16:45:18
CICSB 11/2/2017 14 19:00:00
CICSB 11/2/2017 65 19:00:00
CICSB 11/2/2017 12 19:00:00
CICSC 11/1/2017 14 19:00:00
CICSC 11/2/2017 65 19:00:00
CICSC 11/2/2017 13 19:00:00
|
Need assistance in getting the output file in the format showed in example( if there are multiple records for the same date then add up 3rd column, display sum in 3rd column)
Ex: CICSA got multiple record for the date( 11/1/2017) then sum(1 +2+10+12 = 25),
CICSA 11/1/2017 25 16:45:18
Output File:
Code: |
CICSA 11/1/2017 25 16:45:18
CICSA 11/2/2017 92 19:00:00
CICSB 11/1/2017 105 16:45:18
CICSB 11/2/2017 91 19:00:00
CICSC 11/1/2017 14 19:00:00
CICSC 11/2/2017 78 19:00:00 |
CODE' d
right aligned the numeric fields |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2018 Location: USA
|
|
|
|
Hum-m-m-
Quote: |
Occupation: IT Manager
Mainframe Skills: JCL COBOL VSAM
|
Quick test:
2 * 2 = 4 ?
True, or false? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
So what have you tried and what were the results ?
and dare I ask if the data layout is as dynamic as shown.
RECFM, LRECL, field positions and data types are all required if you want any help. |
|
Back to top |
|
|
sharana64
New User
Joined: 30 Dec 2017 Posts: 2 Location: USA
|
|
|
|
Thank you Expat for the reply.
the file is not dynamic, looks misplaced during copy.
Code: |
Organization . . . : PS
Record format . . . : FB
Record length . . . : 80
Block size . . . . : 27920
|
Tried below logic:
Code: |
//SYSIN DD *
INCLUDE COND=(1,4,CH,EQ,C'CICSA')
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(68,8,ZD)
/*
// |
O/P
Code: |
CICSA 11/01/2017 16:45:18 25 |
CODE' d AGAIN |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I wonder why people are not able to describe the requirement without changing it while the work is in progress (*)
in the starting post the TS asked to sum over the <full timestamp ( date and time )>
and the solution which seemed to satisfy him/her/it sums only over the first 4 bytes of the cics-id
(*) probably because it is one of the required skills of an
Quote: |
Occupation: IT Manager |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
the file is not dynamic, looks misplaced during copy.
|
What do you mean misplaced , explain better what you need here? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
What do you mean misplaced |
Obviously the data was not aligned properly in the OP's post and someone code'd it later for him/her.
Quote: |
in the starting post the TS asked to sum over the <full timestamp ( date and time )> |
moving targets....
sharana64 - Your last 'solution' seem to be inconsistent with your original requirement of summing on keys that include date and time, as enrico has rightly pointed out above. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
Obviously the data was not aligned properly in the OP's post and someone code'd it later for him/her
|
Of course but you overlooked the offsets used, that's how OP will get it unless use Builds, So misplaced is poor term used one has to be knowing what is going around the control cards. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
I was trying to suggest someone cleaned up the OP's post, and that the 'misplacing' may not have anything to do with his/her requirement. I will try to clean up this topic (including my posts). Thank you. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
the topic should be locked and the IT manager invited to start a new one with COMPLETE and CONGRUENT DATA
the control cards for the second result he/she/it got do not even agree with the data layout of the initial post |
|
Back to top |
|
|
|