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: Tue Sep 11, 2007 11:53 am
Reply with quote

The requirement is I have to read an input file, check for some if condition
and if the condition is satisfied I have to populate this report column by column.
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.(As per my specs)

I would like to know how to move the fields, how do I check for the EOF column, EOF page.
what other things are to be looked into. I have not been into coding anytime prior to this. I might come up with some very basic queries, icon_biggrin.gif

QS QS QS QS

XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX
XXXX XXXX XXXX XXXX
XXXX XXXX XXXX
XXXX XXXX XXXX

Thanks
Manjusha
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Sep 11, 2007 12:32 pm
Reply with quote

Manjusha,

Provide some examples for better understanding. Your requirement is not clear.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 12:45 pm
Reply with quote

Thanks Murali,

I have to write a program which also has a report program. The specs tha I got says I need to populate the report column by column as i mentioned in my prev mail....oops looks like the alignment of my query changed in my post. QS is the field name of the report. There are 4 such field. After reading a flat file and based on some conditions I need to populate the fields.

let me know what kind of info do you need. Being new to it, I guess I am not able to put the query in a good order.....

Regards,
manjusha
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Sep 11, 2007 12:49 pm
Reply with quote

manjusha,

Quote:
I guess I am not able to put the query in a good order.....

Instead of putting 'XXXX' values, why dont you give some real values and explain your req.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 12:53 pm
Reply with quote

Are we allowed to attach the spec in this forum.....
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Sep 11, 2007 1:20 pm
Reply with quote

Manjusha,

Welcome to the forum. Please read the forum rules before posting anything on the forum. This is very important.

u r nt supposed to put the company docs on the forum. this will disclose company confidential things to public which company may not like. In worst case company may sack you. this only for ur information. u can ask moderator to remove the link frm the forum.

Explain your problem/query in short using some dummy data which helps members to understand the problem u r facing and give u solution on that.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 1:24 pm
Reply with quote

Thanks sandy for the info
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Sep 11, 2007 1:29 pm
Reply with quote

Hi,

u can display the data columnwise in simple way.

define the cols in the WS section and move the data in the particular condition loop and write after moving that record.

like

01 REPORT.

03 COL1 PIC 9(2).
03 FILLER X(5).
03 COL2 PIC 9(2).
03 FILLER X(5).
03 COL3 PIC 9(2).

in conditional para.

MOVE 01 TO COL1
MOVE 02 TO COL2
MOVE 03 TO COL3


WRITE REPORT.

I think this solve ur purpose.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 2:30 pm
Reply with quote

Hi,

Thanks a lot for your quick reply.

I had requested the moderators to remove the Specs.I can still see it:)icon_smile.gif

coming to my query, since it is report pgm, I wanted to know wud my pgm make sure that we have finished populating one column and get to the next column, so on and so forth...

Regards,
manjusha
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 3:17 pm
Reply with quote

hi,

I think what you are asking is not satisfying the coding standar of cobol.I guess if you are asking like..

suppose

empname no. add
a
b
c
i mean to say if you are asking to populate first column totally and then move to next column .is it like that?
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 3:34 pm
Reply with quote

hi Manjusha,
I think after reading the input file,Based on some condition you have to move 1st records or datas of specific column and then you can perform on
the second record and so on .I don't think you first populate the one
column then move to second and so on.Am i clear to you?
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 3:50 pm
Reply with quote

Thanks for your reply,

yes I need to populate the first column and then thenext column so on and so forth. I have four such columns....

what I had been thinking was reading the input file if the condition is satisfied I shall move the reqd record to a W.S.S variable say Q1S1 and then read the second record move it to Q2S2 and so on....and when Q4S4 is moved I will write the record.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 4:04 pm
Reply with quote

Hi,
if i got your reply correctly as i said you have to perform operation on the
first record and then can move on to the second record.
like after reading the first record move the data in the corresponding ws variables Q1S1 to Q1S4.
And then write the record.afterward read the second record and perform the operatin.I think
you are more confused with the cobol coding than to requirement.Why are you confusing yourself to populate the first column then second and
so on.
see you can perform operation only on the record you are reading.
i guess you are clear with what is a record is in a cluster or file?

Am i clear to you.Base line is that You can perform operation on the
record which you have read that time.
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 4:12 pm
Reply with quote

thanks a lot....

I am confused with requirement as well as the cobol coding I guess:)icon_smile.gificon_smile.gif

My requirement is to ....my report will load column by column

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.(As per my specs) [/quote]
.....since it will load column by column I cant write it unless a page is complete...isn't it...

looks like I am confused and confusing others as well....
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Sep 11, 2007 4:15 pm
Reply with quote

Above logic will write all the cols at a time, so not worry abt individual cols icon_smile.gif
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Sep 11, 2007 4:25 pm
Reply with quote

I think reports are never written like wht u demand. icon_eek.gif they are processed account by account and all the cols are populated at the same time otherwise ur program will not be of any use if u are trying to populate whole cols at a time this is bcoz:

1. Program has to process all A/C's for each col.
2. In that case u need to store all the results in the array or something which will consume unnecessary space and time.
3. Total job will take lot of time and space which is not permissible.

Try to figure out exact req and code it with less effort and generalize way.
icon_cool.gif
Back to top
View user's profile Send private message
manjusha.singh

New User


Joined: 14 Jun 2005
Posts: 16
Location: bangalore

PostPosted: Tue Sep 11, 2007 4:35 pm
Reply with quote

thanks so much......I shall try to do it the way you suggested. The mainframe link is down for now:)icon_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: Tue Sep 11, 2007 5:54 pm
Reply with quote

are your input files are more than one.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 5:58 pm
Reply with quote

hi,
i am absolute agree with Help-Me-Out.That is what i am trying to explaining you.Dont bother about column,Process on each record.if required i can give u smail example.
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: Tue Sep 11, 2007 7:41 pm
Reply with quote

Hello,

Quote:
how do I check for the EOF column, EOF page.
There is no need to check for an "EOF column". When you read a record, all of the fields are automatically brought into your program. I am not clear on what you mean by an "EOF page".

As was mentioned before, if you post a small amount of sample data and how you want the output to look, we will better understand your requirement.

If you want to post some of your spec, you can post the requirement without posting any "company info". Make your spec so that it could fit "anywhere". Also, it is best not attach, but rather include the info inline. Several of our better answer providers are not permitted to download attachments.

You mentioned that your post lost alignment. If you use the "Code" tab near the top of the Reply panel, you can preserve your alignment. To see how this works, enter some data "Code"d and click on Preview. This will show you how your post will be seen by the forum.

Good luck 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 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
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 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