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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 03, 2009 5:03 pm
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
Reply with quote

Hi Binop

Thnx for ur help.
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 Jul 04, 2009 6:51 am
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: 8696
Location: Dubuque, Iowa, USA

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

Surrealistic forum, now? 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: Sat Jul 04, 2009 7:24 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 04, 2009 8:14 am
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
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

Moderator Emeritus


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

PostPosted: Sat Jul 04, 2009 10:14 pm
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 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top