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 

accessing vsam files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
laks
Beginner


Joined: 04 Aug 2004
Posts: 10
Topics: 7

PostPosted: Fri Aug 06, 2004 6:37 am    Post subject: accessing vsam files Reply with quote

Hello,

Can we access vasm files through rexx.
I have tried using Rvopen and rvclose commands to open and close
the vsam files.But it's not working.

Can somebody tell me how to access vsam files through rexx.


Regards,
Laks.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Fri Aug 06, 2004 7:13 am    Post subject: Reply with quote

There is nothing within standard TSO/E REXX that supports VSAM access. According to your post, you tried using "Rvopen", which is apparently a service of a third-party add-on package called RLX/VSAM by RAI.

You would need a third-party package, such as the above mentioned RLX/VSAM or REXX/TOOLS, so, if you do have the RLX/VSAM product, why not contact them with your specific problem.

Otherwise, you would need to write your own access modules in whatever language that would suit your purposes. An Internet search might turn up some freeware/shareware programs that would do this.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Aug 06, 2004 7:16 am    Post subject: Reply with quote

LAKS,

The REXX language does not include any particular support for VSAM, and EXECIO does not support it.

Using the REPRO command and a temporary non-VSAM data set, a REXX exec can use EXECIO to retrieve and update VSAM data, as shown in this example:

Code:

   "ALLOCATE DD(TEMPDD) NEW SPACE(1) TRACKS DSORG(PS) LRECL(4095) RECFM(V B)"
   "REPRO IDS(TESTKSDS) OFILE(TEMPDD) FROMKEY('98040') COUNT(1)"
   "EXECIO 1 DISKR TEMPDD"
   PULL Record
   "EXECIO 0 DISKR (FINIS"
   "FREE DD(TEMPDD)"
     <process data in "record" variable>


By combining the PRINT command and the OUTTRAP function, a REXX exec can retrieve VSAM records into a stem variable, as shown in the following example:
Code:

   x=OUTTRAP('rec.')
   "PRINT IDS(TESTKSDS) FROMKEY('98040') COUNT(5) CHAR"
   x=OUTTRAP('off')
   DO i=1 to rec.0
     IF LEFT(rec.i,13) \= 'KEY OF RECORD' THEN
       SAY rec.i
   END


If REPRO and PRINT do not satisfy your VSAM access needs, you may use RXVSAM which is an Assembler language program, which was created to provide this ability. The RXVSAM program is called from a REXX EXEC as a function

Here is a REXX code fragment that invokes RXVSAM to write a single record into an ESDS:

Code:

   "ALLOCATE FILE(VSAMDD) DSNAME('"dsn"') SHR"
   rc = RXVSAM('OPENOUTPUT','VSAMDD','ESDS')
   record = 'Record 1'
   rc = RXVSAM('WRITE','VSAMDD',,'record')
   rxvsam_result = RXVSAM('CLOSE','VSAMDD')


The source can be found here

http://www.xephon.com/arcframe/a012a01

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Mon Nov 10, 2008 3:48 am    Post subject: Reply with quote

Hi Everybody,

I am working in VSE enviroment....
Can anybody please help me in writing the above rexx code for VSE.

The problem i am facing for above methods is,
1. (a)ALLOCATE keyword is throwing error as RC(-3) and (b)how to specify the VSAM file catalog.

2. (a)Seems like OUTTRAP function is not present in VSE and (b)same as 1(a)

Thanks in advance for any help
Computer
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 -> TSO and ISPF 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