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

how to move fields in a report program column by column


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Wed Sep 12, 2007 10:13 am
Reply with quote

It's actually a simple reprt program( though not that simple to me:)icon_smile.gif)

I have to read a file and based on some conditions i have to write. The report has two colum fields say Quality style and irregular style each with pic(7) with a space. So in all it takes 15bytes. In order to cut down on the size of this report I have to place multiple images (columns) of the data across the physical page. The detail information on the report will load in a column by column fashion beginning with the first column and will only proceed to subsequent columns if the number of detail entries dictate.

I tried writting the report and feel I can manage writting it but my problem lies in the fact that I do not how do I put the things supposed to be in the next page as one more column in the 1st page itself and so on till 4th page.

Regards,
Manjusha

I have been thinking of alternatives, I feel I need to define an array. Read my input file and load my table and write the report by taking it from the table....... wonder if this will work....
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed Sep 12, 2007 2:37 pm
Reply with quote

hi manjusa,
well i think first u short the file you are reading and remove the duplicate
data if i am getting your question right.You have to design your
report layout in RD.If you want your page let say contain 16 records
design your report format in such a way.Or if you are using only
FD you have to do it by the logic.

But again why are you thinking again column wise.Its record miss not
column you have to read.
Quote:
I tried writting the report and feel I can manage writting it but my problem lies in the fact that I do not how do I put the things supposed to be in the next page as one more column in the 1st page itself and so on till 4th page.



can you bit clear on the above quote.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Wed Sep 12, 2007 2:55 pm
Reply with quote

thnks purnendu...

wat I want is after the page is populated, I need to populate the next page. right....But in the report my 1st page shud contain report of 4pages

for this I need an array of 2 dimention.

like say
Q1S1(Of the 1st page) Q2S2(of 2nd page) Q3S3(of3rd page) .....

coming in together in 1 page....

looks like my client wants to save on paper:)icon_smile.gificon_smile.gif
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed Sep 12, 2007 6:06 pm
Reply with quote

hi manjusha,
but u tell me how one can have records of three pages in 1 page.i hope
u are able to get it.can u provide some sample data for better clearification.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Wed Sep 12, 2007 6:21 pm
Reply with quote

icon_smile.gificon_smile.gificon_smile.gif I am really breaking my head on it....

actually, my report wud have 2 fields each with pic 7 with a space in between.....that way I am left with 132-15=117. I want to use the next 15bytes to have record of second page and so on.....I think I am not able to explain the requirement......

Thanks a zillion for the help.I have been a member of this forum for quite sometime but never posted anything untill yesterday. It really feels good that there are so many ppl to help. Thanks all.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 14, 2007 12:41 am
Reply with quote

You're welcome icon_smile.gif

Are you having success with your design & coding?

Can you show some sample input data and the output you want when it is processed? Remember that to preserve the alignment of the input and the output to post that part of yojr reply using the "Code" tab.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Sep 14, 2007 11:24 am
Reply with quote

manjusha.singh wrote:
I think I am not able to explain the requirement......
Hi,

If you show the expected output, then, hopefully many of us would be able to understand your requirement better & can offer better suggestion/s. icon_smile.gif

In doing so, please use 'Code' Tab as suggested.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Fri Sep 14, 2007 4:07 pm
Reply with quote

Hi,

Thanks a lot....

I used array to get the report columwise...looks like it will work.....

I reading an input file based on some condition I am to generate this report. I have defined a 2 dimentional array and have populated it.
I plan to write it from the arrar onto my output file

Code:

quality   irreg   quality   irreg   quality   irreg   quality   irreg
style      style  style      style    style     style    style     style

qualty style and irreg style is each of PIC X(7) with a space in between.
which is supposed to be in 1page. That way, now what I have is of 4 pages....


[/quote]

Now I am confused how to write my o/p from the array....I am not very good with looping either:)icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 14, 2007 6:12 pm
Reply with quote

Hello,

Post your array, the output "print line" definition, and what code you have so far.

We will be able to help you make it work.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Fri Sep 14, 2007 6:32 pm
Reply with quote

thanks so much

Code:
01 WS-SELECTION-RPT.                         
  05 WS-SELECTION-ROW OCCURS   25 TIMES.     
    10 WS-SELECTION-COL OCCURS 17 TIMES.     
      15 WS-1ST-QUALITY-STYLE      PIC X(7).
      15 FILLER                              PIC X(1).
      15 WS-IRREG-STYLE            PIC X(7).

The following is my o/p layout but was wondering how wud I populate my o/p from the array....
FD IRRGREPT-FILE                           
        RECORD CONTAINS 132 CHARACTERS     
        BLOCK CONTAINS 0 RECORDS           
        RECORDING MODE IS F               
        LABEL RECORDS STANDARD.           
01 IRRGREPT-RECORD.                                       
  05 FILLER                       PIC X(15) VALUE SPACES.
  05 WS-QUAL-STYLE-1ST            PIC X(7).               
  05 FILLER                       PIC X(1) VALUE SPACES. 
  05 WS-IRRG-STYLE-1ST            PIC X(7).               
  05 FILLER                       PIC X(14) VALUE SPACES.
  05 WS-QUAL-STYLE-2ND            PIC X(7).               
  05 FILLER                       PIC X(1) VALUE SPACES. 
  05 WS-IRRG-STYLE-2ND            PIC X(7).               
  05 FILLER                       PIC X(14) VALUE SPACES.
  05 WS-QUAL-STYLE-3RD            PIC X(7).               
  05 FILLER                       PIC X(1) VALUE SPACES. 
  05 WS-IRRG-STYLE-3RD            PIC X(7).               
  05 FILLER                       PIC X(14) VALUE SPACES.
  05 WS-QUAL-STYLE-4TH            PIC X(7).               
  05 FILLER                       PIC X(1) VALUE SPACES. 
  05 WS-IRRG-STYLE-4TH            PIC X(7).               
  05 FILLER                       PIC X(15) VALUE SPACES.



please let me know what shud be the o/p layout if this is not proper:)icon_smile.gificon_smile.gif
it's a report....

will try to read some book over the weekend to be able to work on this on moday.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 14, 2007 7:14 pm
Reply with quote

Hello,

For starters, i'd suggest making the output print line an "occurs 4" array (pretty much like you did the "selection-col" array but with a filler after each field to get the spacing you want on the report).

Then building a print line will just be a matter of pointing to the correct "sending field" and "receiving field". You would not need logic to determine whicn bit code for which receiving field name as you would use the "same" name rather than the -1st, -2nd, etc.

Also, values specified in an FD are either invalid or ignored, so a MOVE spaces to IRRGREPT-RECORD would be the start of each iteration of building an output line.

When you have some procedure code written, post that (both loading the array and building the print line).

Some of us monitor the forums over the weekend, so if you post anything, someone will see it fairly soon icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 15, 2007 3:00 am
Reply with quote

First, please use [code] and [/code] tags,it makes your posts easier to read. For info use this link for BBCode.
The BBcode will maintain the spacing between characters in your examples.

Second, this sounds like a situation where you would to define your printline as a COBOL table. This would provide you a method to populate the report columns.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Sep 15, 2007 3:02 am
Reply with quote

hey dick, sorry for the duplication. I did not notice that this thread went to three pages.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 15, 2007 3:05 am
Reply with quote

Hi Dick,

Re-enforcement is a good thing icon_smile.gif
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Wed Sep 19, 2007 6:06 pm
Reply with quote

Thanks a lot,

I am done with the program.I used occurs for the o/p as well.....

Thanks so much for the help.

Regards,
Manjusha
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 19, 2007 8:34 pm
Reply with quote

You're welcome icon_smile.gif

Good to hear that it is working properly - congrats!
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 -> COBOL Programming Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top