|
View previous topic :: View next topic
|
| Author |
Message |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi,
I have a report(FBA,LREC=133) which I want to split into two files.
The first part is the individual code and their count for some ORG no.
The second part is the sum of the counts of these codes
The report is something like this
ORG-002
CODE COUNT
0001 10
0001 15
0002 20
0003 05
0003 10
0003 15
ORG-02
CODE COUNT
0001 25
0002 20
0003 30
The first part (ORG-002) is code and their counts. There can be duplicate code in first part. The second part (ORG-2) is the summation (total) of the code counts. Now I want to split the first half and second half in to different files. The only differenct that can be seen is that indidual CODE have ORG no as ORG-00 i.e there are 2 zeros after ORG. For summation level data, there is only one zero after ORG. (ORG-0)
Can anyone help me to split the files? |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
| Can you please show us some examples how the input file looks like? |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
| It looks same as that I have explained in my fisrt post. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Shriram Jogdand wrote: |
| It looks same as that I have explained in my fisrt post. |
Then I'd suggest amending the report to do the second group at "head of form" if it does not already, then, when it is printed, "tear along the dotted line".
If already at head of form, just go straight to the "tear..." bit.
gylbharat is asking for clarification of your requirement so that he can try to help. If there was sufficient information already, he wouldn't have to ask.
If that really is all your report is, then I stick by my suggestion as a workable solution.
Let me guess though, things aren't exactly as your wrote in your first post...? |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
ORG - 001
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
112 0 ,00
127 2 1.117,36
135 1 15.038,50
005 859 85.421,44
006 0 ,00
010 1 40,00
012 4 1.841,10
014 7 210,00
020 0 ,00
050 1 35,86
110 0 ,00
112 0 ,00
124 0 ,00
127 6 285,81
135 1 204,64
149 4 28,00
227 0 ,00
ORG - 01
TRAN DEBITS
CODE COUNT AMOUNT
005 5,369 928.079,48
010 3 93,81
012 14 37.422,87
014 48 1.395,00
050 2 547,99
127 25 2.577,62
135 7 16.693,76
149 14 98,00
150 1 384,97
226 1 190,00
361 1 2.000,00
006 0 ,00
015 0 ,00
020 0 ,00
110 0 ,00
112 0 ,00
124 0 ,00
131 0 ,00
134 0 ,00
151 0 ,00
227 0 ,00 |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
Shriram Jogdand,
after 53 posts, you can use the code tags, here is how
first you provide a rather elitest
(no scratch that)
a childish response to a question
and then just blast garbage on the webpage.
with the code tags, we would know what column positions in which data resides.
now, we would have to wade thru this crap to determine column positions,
if we wanted to provide you with a solution.
if you want a solution,
suggest you start playing like a professional. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Still no headings? Not even a business date that the report is produced for? Page numbers?
You are now showing 001/01. Can we guess that this is followed by 002/02? So that you have alternate "chunks" of report that you want to split?
By far the easiest is to go back to the program that produces the report, and to do two seperate reports. If you can't do this, let us know why not before we go chasing solutions.
To split the report from DFSORT/ICETOOL we'd need to be able to accurately identify the stuff you want on one report and the stuff you want on the other.
As yet, we can't do this.
Sit down and look at your report. Think hard about what you would need to know with a robot collator. Work out exactly what you'd need to know to program the robot. That is what we'd need.
If you are not yet experienced in this method, try this: work out exactly what you need to do to make a cup of tea how you like it. Write it all down. Then make a cup of tea exactly as you have written it all down. If you get it right first time (I've never seen it done) then you are a genius, and you won't need us. If you don't get it right, then you'll get a better idea of how you have to explain things to people when you have a problem seeking a solution.
Someone has in their sig, something like "a problem explained well is a problem half-solved". Often, in just explaining everything without your pre-conceptions about what others "should" know, but don't, you'll even come to your answer. |
|
| Back to top |
|
 |
THINKSRINIII Warnings : 1 New User
.jpg)
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Will your input file contain only one set of data. i.e Will it have only ORG 001 and ORG 01. Or Will there be multiple occurances?
ORG -001
ORG -01
ORG -002
ORG -02
Will it always occur in this order ?  |
|
| Back to top |
|
 |
kratos86
Active User

Joined: 17 Mar 2008 Posts: 148 Location: Anna NGR
|
|
|
|
Still the requirements are not clear. As per my understanding, If your input file has both the individual records and summed value record.
1. sort your file with the code and count in descending order.
2. Extract the first duplicate of all the code (which is the summation of the count record) in one file and other file will have all the remaining count values.
If this is not what you intended, you need to explain us clearly how your input file look like and what is the expected output. |
|
| Back to top |
|
 |
Shriram Jogdand
New User

Joined: 14 Oct 2008 Posts: 65 Location: Pune
|
|
|
|
Hi kratos86,
Thanks for your help. It worked for me. Actually I dont know how to paste the mainframe screen here in forum. So I tried to copy paste the main lines from the report.
Sorry for the confusion but really thanks for the help. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
since you missed it in my first post,
thought that I would repost, with a little larger font size so that you can see it:
code tags, here is how
|
|
| Back to top |
|
 |
THINKSRINIII Warnings : 1 New User
.jpg)
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
DFSORT Alternate option to obtain File 1
| Code: |
//SYSIN DD *
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'ORG'),OVERLAY=(15:C'YYY'),
HIT=NEXT),
IFTHEN=(WHEN=(1,6,CH,EQ,C'ORG-00'),OVERLAY=(25:C'XXX'))
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(15,3,CH,EQ,C'YYY',AND,
25,3,CH,EQ,C'XXX'),
END=(15,3,CH,EQ,C'YYY',AND,
25,3,CH,EQ,C' '),PUSH=(31:ID=1),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,C'ORG',AND,7,1,CH,EQ,C' '),
BUILD=(1,30,31:C' '))
OUTFIL FNAMES=OUTPUT,INCLUDE=(31,1,CH,NE,C' ')
//STEP0002 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//DFMSG DD *
//SORTIN DD DSN=&&TEMP1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,10) |
Code'd
The same could be modified to get File 2. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Your reply has been "Code'd". Is there some reason you did not use the Code tag? |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Your requirement is clear as mud.... But thought of being psychic..
What I understood is..
You have some report which has multiple ORG segments followed by report details.. You want to have seperate output files for each segments...
Input:
| Code: |
ORG - 001
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
ORG - 01
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
112 0 ,00
127 2 1.117,36
135 1 15.038,50
ORG - 002
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
ORG - 02
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
112 0 ,00
127 2 1.117,36
135 1 15.038,50
|
SORT STEP:
| Code: |
//STEP10 EXEC PGM=SORT
//SORTIN DD DSN=HLQ.FBA.L133.FILE,DISP=SHR
//OF1 DD DSN=HLQ.OP1
//OF2 DD DSN=HLQ.OP2
//OF3 DD DSN=HLQ.OP3
//OF4 DD DSN=HLQ.OP4
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,EQUALS
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,3,CH,EQ,C'ORG'),PUSH=(134:ID=8))
OUTFIL FNAMES=OF1,INCLUDE=(134,8,ZD,EQ,1),BUILD=(1,133)
OUTFIL FNAMES=OF2,INCLUDE=(134,8,ZD,EQ,2),BUILD=(1,133)
OUTFIL FNAMES=OF3,INCLUDE=(134,8,ZD,EQ,3),BUILD=(1,133)
OUTFIL FNAMES=OF4,INCLUDE=(134,8,ZD,EQ,4),BUILD=(1,133)
/*
|
Output:
File1:
| Code: |
ORG - 001
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
|
File2:
| Code: |
ORG - 01
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
112 0 ,00
127 2 1.117,36
135 1 15.038,50
|
File3
| Code: |
ORG - 002
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
|
File4
| Code: |
ORG - 02
TRAN DEBITS
CODE COUNT AMOUNT
005 306 27.677,91
006 0 ,00
010 1 40,00
014 5 135,00
020 0 ,00
110 0 ,00
112 0 ,00
127 2 1.117,36
135 1 15.038,50
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|