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
 

 

Need program logic for the VSAM manipulation

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

New User


Joined: 13 Sep 2005
Posts: 18

PostPosted: Fri Oct 28, 2005 7:08 pm    Post subject: Need program logic for the VSAM manipulation
Reply with quote

i am new to mainframes so,could anyone help me on this below problem
i have two files with following record structures.
file-1.
*******

primary key :reg-no
---------------------------------------------
REg-no Nric1 nric2 nric3 nric4
---------------------------------------------
123 aaaa ccccc eeeee ffff
456 wwww yyyyy
----------------------------------------------


file2
******

primary key : reg-no and nric.
reg-no nric name
--------------------------
123 aaaa xxxxxxxxx
123 bbbb xxxxxxxx
123 cccc xxxxxxxxx
123 dddd xxxxxxxxx
123 eeee xxxxxxxxx
123 ffff xxxxxxxxx
456 vvvv xxxxx
456 wwww xxxxx
456 xxxx xxxxx
456 yyyy xxxxxxxxxx

both the files are vsam files
i have to browse the file2 until eof
or change in regestration number.

my report file should be like this

-----------------------------


s.no regn-no nric name
------------------------------------------------------
1 123 aaaa xxxxxxx
cccc xxxxxxx
eeee xxxxxxx
ffff xxxxxxx


bbbb xxxxxxx
dddd xxxxxxx

2 456 wwww xxxxxxxx
yyyy xxxxxxxx


vvvv xxxxxxx
xxxx xxxxxxx.

can any one give me program logic for
the above problem.
Back to top
View user's profile Send private message

EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Sat Oct 29, 2005 12:00 pm    Post subject:
Reply with quote

Hi

this can be done by cobol program & sort utility
in cobol program

1. open 2 files
perform read-file until file-status = '10'
2. read the 1st file ,& get the data of ist record into the copy book
3.perform file2-read until ws-eor='y'
set 'n' to ws-eor( working storage of picx(1))
read the 2nd file
if regno of 1st file Not = reg-no of 2nd file
set 'y' to ws-eor
else
Nric1 of 1st file = nric of 2nd file or
Nric2 of 1st file = nric of 2nd file or
Nric3 of 1st file = nric of 2nd file or
Nric4 of 1st file = nric of 2nd file
if Satisfied populate the data to 3rd ile as of like this
1 123 aaaa xxxxxxx
cccc xxxxxxx
eeee xxxxxxx
ffff xxxxxxx
else populate
bbbb xxxxxxx
dddd xxxxxxx


4 close both the files
*************************************************************
But the logic has an issue , how should we handle the records of 2nd file
that ie
file 1
111 aaaa
222 bbbb
333 cccc

file2
111 aaaa ppppp
555 bbbb ttttttt
666 gggg ddddd

if the input of the files area like above, then we are not taking care of
file2 ( 555, 666 )
************************************************************

i am not sure how to do with sort, if i get to know i will post it

Thanks
prasad
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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


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