View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed Jun 11, 2008 8:48 pm Post subject: Program logic needed |
|
|
Hai,
I have a file as below:
Code: |
ABC MAINFRAMES
ABC MAINFRAMES
ABC MAINFRAMES
ABC MAINFRAMES
DEF JAVA
DEF JAVA
DEF JAVA
DEF JAVA
XYZ ASP
|
I want the output in the way as below with first the header coming and then the detail record and whenever the department changes i want to have 3 blank lines and then again header and detail record should come and i want program logic for this not SORT as i want to implement in program only.
Code: |
DEPT DEPTNAME
ABC MAINFRAMES
ABC MAINFRAMES
ABC MAINFRAMES
ABC MAINFRAMES
DEPT DEPTNAME
DEF JAVA
DEF JAVA
DEF JAVA
DEF JAVA
DEPT DEPTNAME
XYZ ASP
|
|
|
Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Jun 12, 2008 1:07 am Post subject: |
|
|
Excuse me, but does this mean you want us to do the work for you so that you can get the credit for it? It does not look like you have even attempted to make a solution with either a program or a utility (for example DFHSORT). |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Jun 12, 2008 3:44 am Post subject: |
|
|
Basic control-break processing. Any decent programming book will have examples. If you are at work then look at other programs around - a lot of them will have some sort of thing that is similar. If you are at school then the lecturere should have told you enough to figure it out and your recommended text books would definitely have it. Even if not then you should be able to come up with some idea which you can try out.
clue 1 - do while not eof
clue 2 - do while same key _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
jsharon1248 Intermediate
Joined: 08 Aug 2007 Posts: 291 Topics: 2 Location: Chicago
|
Posted: Thu Jun 12, 2008 9:56 am Post subject: |
|
|
clue 3 - show some effort and provide details, like, oh, I don't know, the language you're using |
|
Back to top |
|
 |
|
|