Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read records from a PS file and move to a array.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
bhartiG

New User


Joined: 26 Jun 2009
Posts: 2
Location: delhi

PostPosted: Fri Jul 03, 2009 10:08 am    Post subject: Read records from a PS file and move to a array.
Reply with quote

Hi,

I have to read records with pic 9(4) from a PS file and move the same in an array until end of file.

the structure of array is :
10 ws-array occurs 50 times
05 ws-Id pic 9(4)

please tell me how to do this.
Back to top
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Jul 03, 2009 10:21 am    Post subject:
Reply with quote

Hi Geetu,

The process is pretty straight forward and u would get the details from any COBOL manuals.

If you are new to COBOL, plz look into PERFORM statments.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jul 03, 2009 5:03 pm    Post subject:
Reply with quote

Is this a class exercise?
Back to top
View user's profile Send private message
bhartiG

New User


Joined: 26 Jun 2009
Posts: 2
Location: delhi

PostPosted: Fri Jul 03, 2009 5:16 pm    Post subject:
Reply with quote

Hi Binop

Thnx for ur help.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Jul 04, 2009 6:51 am    Post subject:
Reply with quote

Hello,

One of the more lacking in continuity topics in quite a while. . .

TS doesn't answer direct question asked, but offers appreciation for an answer that still has me puzzled. . .

How does PERFORM relate/equate to reading a file until eof and getting (some of?) the data from the file into an array? What a giant leap. . . icon_confused.gif

I guess all that really matters is that at some level communication happened and Geetu is/was able to proceed with the homework.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Sat Jul 04, 2009 7:10 am    Post subject:
Reply with quote

Surrealistic forum, now? icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Jul 04, 2009 7:24 am    Post subject: Reply to: Read records from a PS file and move to a array.
Reply with quote

And Expat said that psychic day was canceled this week. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Sat Jul 04, 2009 8:14 am    Post subject:
Reply with quote

Does that mean we have two next week to make up?
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Sat Jul 04, 2009 12:45 pm    Post subject:
Reply with quote

Hi guys,

I was suggesting the PERFORM statment so that Geethu could READ 50 times from the file and MOVE into the arrary. I was guessing Geethu was having problem with the array.

Plz correct me if i am wrong... I am also working my way into the forum... icon_wink.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Jul 04, 2009 10:14 pm    Post subject:
Reply with quote

Hello,

I suspect that both Robert and i both quite understood what you meant by the earlier reply (because we both - as well as most others who read this - understood the requirement and how to meet it).

What is still a mystery to me is how a complete beginner was to take sufficient meaning from the mere mention of PERFORM. Some kind of perform loop could handle reading the file (which should not be a loop of 50) but has nothing to do with initializing and loading an array (yup, as the items are numeric, they should be initialized to some valid numeric value).

One of the things we try to do for the inexperienced is help them learn how to properly ask a question. Many of the questions posted here (though they should be posted in our "student & fresher" forum instead) are homework assignments rather than business requirements. Hopefully, no business would assign such a task and would not hire someone who did not already know how to do this. The student forum is http://www.ibmmainframeforum.com
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us