XXXX.file1.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
WRITTEN 00000008
DELETED 00000005
XXXX.file2.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
WRITTEN 00000058
DELETED 00000000
XXXX.file3.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
WRITTEN 00000658
DELETED 00000000
Output file :
LRECL 80 FB
File name Rec count
Code:
DATE : 2011-02-22 or any date format
XXXX.file1.data : WRITTEN - 00000008 DELETED 00000005 ( OR ZERO SUPPRESSED)
XXXX.file2.data : WRITTEN - 00000058 DELETED 00000000
XXXX.file3.data : WRITTEN - 00000658 DELETED 00000000
Can anyone help me to acheive the result in SORT. My shop prefers SORT before ICETOOL.
_________________
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Feb 23, 2011 12:40 pm Post subject:
radkrish82,
Use the following DFSORT JCL which will give you the desired results. If you want the leading zeroes suppressed , use M10 instead of M11 in the TOT parm on trailer3.
Thanks, Kolusu. The main reason for cross posting is, most of the times mvsforum doesn't open in my office desk network. I have to walk to library to post my queries. becoz of work, if I am not able to leave my seat, i search for other forums. Hence you find cross posting. no other reasons. I requested my admin to permanently allow this web at my desk network. so that I can use this reliable forum all time from my desk itself.
Kolusu, 133 report for me comes as FBA. sry for rework.
I increased one byte to positions. But I am not getting desired output. count is also not matching.
Command ===>
----+----1----+----2----+----3----+----4----+----5----+----6
********************************* Top of Data **************
DATE : 2011-02-24
RCDS : WRITTEN - 00008290 DELETED - 00000000
******************************** Bottom of Data ************
My desired output
Code:
DATE : 2011-02-22
XXXX.file1.data : WRITTEN - 00000008 DELETED 00000005
XXXX.file2.data : WRITTEN - 00000058 DELETED 00000000
XXXX.file3.data : WRITTEN - 00000658 DELETED 00000000
File name should also come since I am giving 3 reports in concatenation to SORTIN.
Actual Report content looks like the one given below and also the one given in my prev post.
Code:
XXXXX 08 0
XXXXX 09 1 83604S67
XXXXX 10 0
TOTALS 4
YYYYYY-XXX 02/22/2011
NO OF RECORDS FOR THIS RUN.
ZZZZZZZ TOTALS FOR RPT TESTREPORT
RCDS WRITTEN 00000058
RCDS DELETED 00000000
For 3 or more files in concatenation, will it work, since it merges together in input. or do we need to follow different SORT steps. Pls advise.
Maximum files upto 10. File output should differentiate record written/deleted for each files. Sorry for the trouble and am clear with the reqmt now.
All files looks similar except the data content in it. Eg., previous day report, prev to previous day report are available. Hence I need to differentiate each count for each files. Pls help me in this case.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Feb 24, 2011 12:07 pm Post subject:
radkrish82 wrote:
All files looks similar except the data content in it. Eg., previous day report, prev to previous day report are available. Hence I need to differentiate each count for each files. Pls help me in this case.
Radkrish82,
When you concatenate the files , there is no way to distinguish the records. But I guess we can use the 'date field' on 'YYYYYY-XXX 02/22/2011' record as identifier and get the desired results
Doe each file have a record which starts with YYYYY? followed by a date? Can you have multiple YYYYY records in a single file?
If the YYYYY records are unique , then what is the position of the date and format of the date?
And you need to do a better job of explaining your requirements properly. _________________ Kolusu
www.linkedin.com/in/kolusu
Doe each file have a record which starts with YYYYY? followed by a date? Can you have multiple YYYYY records in a single file?
All files have record starting with YYYYY followed by date.
Yes, we have multiple yyyy records. Basically its a report name. So it is same for all files tht am taking into account. we can't differentiate in that matter. Similar dates is found in two or more files.
Quote:
If the YYYYY records are unique , then what is the position of the date and format of the date?
Its not unique.
A report is splitted into more than two files based on report indicator in the actual report on first position. I am taking the count of splitted files and not bother about the report. eg., if 3 files are splitted, then all files will have same report name and date. In this case, i can differentiate first file as file1, second as file2 and third as file3 inorder to show a count of all 3 files in single dataset.
Without concatenation, using SORT, Is there any function/control card like we use to count total number of records in a multple file eg., COUNT from(infile) write(output) text('file1-) char(8 ) digits(8 )
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Feb 24, 2011 12:54 pm Post subject:
radkrish82 wrote:
Without concatenation, using SORT, Is there any function/control card like we use to count total number of records in a multple file eg., COUNT from(infile) write(output) text('file1-) char(8 ) digits(8 )
Read the documentation of COUNT function of ICETOOL with examples here
Or can we go by following to acheive the result.
1. 3 input files 3 output files
2. Use include condition to filter only WRITTEN and DELETED record
3. Build outrec or outrec fields=(C:'file1:',27,8,66x)
4. concatenate these 3 output files to have single output file containing all these counts
But "DELETED" will be on second line next to WRITTEN. how to PUSH to first line?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Feb 24, 2011 2:25 pm Post subject:
radkrish82,
I am not sure as to why you need to complicate a simple requirement. You said the input files are the output files from a split job. Why can't you get this report in the same split job itself? Why the additional concatenation and merging? _________________ Kolusu
www.linkedin.com/in/kolusu
Kolusu, The split job is running from production. shouldn't be disturbed. The adhoc request is to take the resulted split files and put the necessary count into catlgd dataset. For adhoc, we don't write a program. So we are trying to satisfy the reqmt within SORT. If someone can pls update me how to push the second line (DELETED) to first line within same FB LRECL 80. Or if you have any other alternate solution rather than complicated one I mentioned, I will be happy to use it. Thanks for all your help.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum