MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL Array program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
manasa paduru
Beginner


Joined: 20 Jul 2007
Posts: 2
Topics: 2

PostPosted: Thu Jan 06, 2011 8:45 am    Post subject: COBOL Array program Reply with quote

I have a table Employee Columns as below
Table: Employee
Column Type Size
Empid Char 10
Firstname Char 30
Lastname Char 30
Midname Char 30
Legalname Char 60

There are 'n' number of rows in the table.
Would like to do a block read of the table data
Please write a small program (COBOL) thru which you can read 100 records at time and store them in memory.
Assumption there are a max of 300 but can be more than that.



Concatenate the firstname middlename and lastname by seperating each field with a comma ',' and write the
output to legalname field into the table. (This again has to be a block update to the table)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Thu Jan 06, 2011 12:09 pm    Post subject: Reply with quote

manasa paduru,

Read this

Multi-row FETCH Using DB2 V8 example

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Sun Jan 23, 2011 3:46 am    Post subject: Manasa - that's not how a forum works Reply with quote

You cannot seriously expect someone to write the program for you ???

What happens with your next program - do you intend to post a description of it here and ask someone to write that as well ??

I see the point with a forum as being twofold:-

    post a problem where you've done some preliminary work and your results are "incorrect" without you understanding why

    or something along the lines of "I'm trying to do this - is there a command or similar that allows it and what is that command"
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Jan 24, 2011 3:42 am    Post subject: Reply with quote

as you study and attempt to learn enough to accomplish this task,
spend some time learning the proper definitions of technical terms.

1. COBOL Internal Table - not array
array is only applicable when speaking of Host Varaibles used in DB2 Mutli-row Fetch situation.

2. records and fields are unique to files.
3. elements and items are unique to Cobol Internal Tables (also applicable to an array)
4. columns and rows are unique to DB2 tables.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group