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
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 Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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
Search our Forums:

Back to Top