Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to repeat part of previous records in the following rec

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to repeat part of previous records in the following rec
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    Post subject:
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: 331
Location: USA

PostPosted: Fri Sep 04, 2015 9:24 am    Post subject: Reply to: Need to repeat part of previous records in the following rec
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    Post subject:
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: 331
Location: USA

PostPosted: Fri Sep 04, 2015 7:25 pm    Post subject: Reply to: Need to repeat part of previous records in the following rec
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Sep 04, 2015 7:25 pm    Post subject: Reply to: Need to repeat part of previous records in the following rec
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: 331
Location: USA

PostPosted: Fri Sep 04, 2015 8:42 pm    Post subject: Reply to: Need to repeat part of previous records in the following rec
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us