IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to repeat part of previous records in the following rec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
akashs

New User


Joined: 24 Nov 2005
Posts: 49
Location: chennai

PostPosted: Fri Sep 04, 2015 8:58 am
Reply with quote

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
View user's profile Send private message
akashs

New User


Joined: 24 Nov 2005
Posts: 49
Location: chennai

PostPosted: Fri Sep 04, 2015 9:04 am
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Sep 04, 2015 9:24 am
Reply with quote

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
View user's profile Send private message
akashs

New User


Joined: 24 Nov 2005
Posts: 49
Location: chennai

PostPosted: Fri Sep 04, 2015 7:09 pm
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Sep 04, 2015 7:25 pm
Reply with quote

By multiple reports you mean multiple headers Or is there more to it ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 04, 2015 7:25 pm
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Sep 04, 2015 8:42 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top