View previous topic :: View next topic
|
Author |
Message |
akashs
New User
Joined: 24 Nov 2005 Posts: 49 Location: chennai
|
|
|
|
hi ,
I need to repeat the portion of the previous record in the following records with blank spaces. Format of both Input file and output file is FBA.
Example of Input report file:
Code: |
CONSUMER REPORT
RUN DATE : 07/07/2015 PAGE 1
COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8
A1000 JOHN E.BRUNSWICK 4000 6000 8000 1000 9000
A5000 PETER BOSTON 4100 6200 8000 1600 9400
7503 6210 8020 1670 9488
7504 6210 8020 1670 9488
7505 6213 8026 1678 9489
A6400 BROWNE PORTLAND 9100 6900 8900 1605 9430
CONSUMER REPORT
RUN DATE : 07/07/2015 PAGE 2
COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8
A1000 HENDRICK HAMDEN 4000 6000 8000 1000 9000
A5000 MARY SIMSBURY 4100 6200 8000 1600 9400
7503 6210 8020 1670 9488
A6400 IYLENE PORTLAND 9100 6900 8900 1605 9430 |
Below is the example of output report format which I need.
Can anyone please help me out this requirement using DFSORT.
Code: |
CONSUMER REPORT
RUN DATE : 07/07/2015 PAGE 1
COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8
A1000 JOHN E.BRUNSWICK 4000 6000 8000 1000 9000
A5000 PETER BOSTON 4100 6200 8000 1600 9400
A5000 PETER BOSTON 7503 6210 8020 1670 9488
A5000 PETER BOSTON 7504 6210 8020 1670 9488
A5000 PETER BOSTON 7505 6213 8026 1678 9489
A6400 BROWNE PORTLAND 9100 6900 8900 1605 9430
CONSUMER REPORT
RUN DATE : 07/07/2015 PAGE 2
COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8
A1000 HENDRICK HAMDEN 4000 6000 8000 1000 9000
A5000 MARY SIMSBURY 4100 6200 8000 1600 9400
A5000 MARY SIMSBURY 7503 6210 8020 1670 9488
A6400 IYLENE PORTLAND 9100 6900 8900 1605 9430 |
Thanks,
Akash
Code'd, for what it was worth |
|
Back to top |
|
|
akashs
New User
Joined: 24 Nov 2005 Posts: 49 Location: chennai
|
|
|
|
Sorry the columns got messedup when i copy pasted .
values in the input report file namely 7503 6210 8020 1670 9488 starts from COL3 TO COL8.
7504 6210 8020 1670 9488 and 7505 6213 8026 1678 9489 also starts from COL3 TO COL8. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
First thing is: Learn to use code tags. It's been 10 years for you on the forum.
Now, do your columns have fixed length or the length of columns variable? i.e. Col2 ends with a certain position or it's variable.
If the length of columns fixed then it should be pretty easy with IFTHEN=(WHEN=GROUP where your group can start with a non-blank character at position 1 and then you need to PUSH Col1 and Col2 i.e. PUSH the length starting from column 1 to the end of Column 2. There are lots of examples on the forum on how to do that. Or read the DFSORT manual.
Post again on the forum if you face difficulty.
. |
|
Back to top |
|
|
akashs
New User
Joined: 24 Nov 2005 Posts: 49 Location: chennai
|
|
|
|
Thanks for your reply Rahul...
I don't know , what do you mean by "code tags!!!"..
It's good to know that you are typing great here for less than a year...
I have first read the DFSORT manuals..not able to see a similar example there..
If you can't suggest a solution, Please let others to help me out for this solution rather than asking me to venture into millions of examples out there in Internet..
Can you tell me how you can do this using "WHEN=GROUP" and the columns size is fixed in this report. Remember the file has multiple reports.
Thanks,
Akashs |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
By multiple reports you mean multiple headers Or is there more to it ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
RahulG31 has already given you a good hint on how to do it. You can find an example in the DFSORT Gettting Started publication, as well as the Application Programming Guide, searching here, searching the web.
How can we "remember" that the file has multiple reports? You'd probably be best to PUSH to a temporary extension to the records, and then use IFTHEN=(WHEN=(logicalexpression) to identify your data-records, and relocate the PUSHed data to where you want it. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Quote: |
I don't know , what do you mean by "code tags!!!"..
|
Quote: |
If you can't suggest a solution, Please let others to help me out for this solution rather than asking me to venture into millions of examples out there in Internet..
|
Very Poor choice of words by someone asking for help. You were already given enough hint and If only you would have done something about it you would have got it. The fact is that you are not looking for a suggestion, You want someone to work for you and give you a solution (for free).
And actually I might have given you the solution (for free) if you had behaved properly.
. |
|
Back to top |
|
|
|