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

assign 20 lines of the sequential file to 20 fields -NATURAL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
santhoshm

New User


Joined: 13 Jun 2007
Posts: 32
Location: chennai

PostPosted: Thu Jul 12, 2007 10:14 am
Reply with quote

Hi,
Can some one tell me the solution for this problem.
1650 READ WORK 5 #INPUT-TEXT-RECORD
1660 END-WORK

I have to get simple text(of 20 lines) from a sequential file and these 20 lines have to be assigned to 20 variables.
The variable declarations are

445 1 #INPUT-TEXT-RECORD (A1500)
0450 1 REDEFINE #INPUT-TEXT-RECORD
0455 2 #TEXT-LN1 (A75)
0460 2 #TEXT-LN3 (A75)
0465 2 #TEXT-LN4 (A75)
0470 2 #TEXT-LN5 (A75)
0475 2 #TEXT-LN6 (A75)
0480 2 #TEXT-LN7 (A75)
0485 2 #TEXT-LN8 (A75)
0490 2 #TEXT-LN9 (A75)
0495 2 #TEXT-LN10 (A75)
0500 2 #TEXT-LN11 (A75)
0505 2 #TEXT-LN12 (A75)
0510 2 #TEXT-LN13 (A75)
0515 2 #TEXT-LN14 (A75)
0520 2 #TEXT-LN14A (A75)
0525 2 #TEXT-LN15 (A75)
0530 2 #TEXT-LN16 (A75)
0535 2 #TEXT-LN17 (A75)
0540 2 #TEXT-LN18 (A75)
0545 2 #TEXT-LN19 (A75)
0550 2 #TEXT-LN20 (A75)
I wrote the following displays in the program.

1630 WRITE ' #TEXT-LN1' #TEXT-LN1
1635 WRITE ' #TEXT-LN3' #TEXT-LN3
1640 WRITE ' #TEXT-LN4' #TEXT-LN4
1645 WRITE ' #TEXT-LN5' #TEXT-LN5
1650 WRITE ' #TEXT-LN6' #TEXT-LN6

But in output I can only one line that is
#TEXT-LN1 VERY TRULY YOURS,
#TEXT-LN3
#TEXT-LN4
#TEXT-LN5
#TEXT-LN6
The line #TEXT-LN1 is also displaying the value of last line of the sequential file.
I would like to assign 20 lines of the sequential file to 20 fields as above.
Please let me know how to solve this issue.
This is a natual programming language.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Jul 12, 2007 1:00 pm
Reply with quote

Why #INPUT-TEXT-RECORD is defined as a group and not as an array????


O.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top