Write VSAM file thru rexx



IBM's Command List programming language & Restructured Extended Executor

Write VSAM file thru rexx

Postby arya_starc » Mon Oct 22, 2018 1:57 am

I write a rexx, in which user enter the value in tso and I pull that value thru rexx.I need to write that particular value in VSAM file.
Code is working fine when I am using PS file for write but it is getting fails for VSAM file.

IRX0553E The input or output file OU2 must be allocated to a sequential data se
t, or single member of a partitioned data set.                                  
IRX0670E EXECIO error while trying to GET or PUT a record.
 


As per error, I need to used only sequential file is it?
If not,Please tell how can I write in vsam file thru rexx.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Write VSAM file thru rexx

Postby Robert Sample » Mon Oct 22, 2018 3:43 am

REXX does not natively support VSAM access. You can install RXVSAM at your site to do this, but without installing the program (or writing a subprogram in the language of your choice to do the access) you will not be able to access VSAM data sets with your REXX code.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Write VSAM file thru rexx

Postby expat » Mon Oct 22, 2018 11:37 am

The only way in which I have accessed VSAM within a REXX is by invoking IDCAMS.

It's O)K for a small number of records calls and updates, but most definitely not the way to go with many
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Write VSAM file thru rexx

Postby willy jensen » Mon Oct 22, 2018 2:05 pm

REXX has no native VSAM support, but www.cbttape.org has at least 2 free programs for accessing VSAM:
RXVSAM in file 268 for reading and writing record-by-record
RXVSAMBA in file 699 for reading and write blocks of records to/from stem.
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Write VSAM file thru rexx

Postby willy jensen » Mon Oct 22, 2018 5:42 pm

If you only want to write then you can write the records to a sequential dataset and use the REPRO command to update the VSAM cluster.
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Write VSAM file thru rexx

Postby arya_starc » Tue Oct 23, 2018 5:12 pm

I works in company as a mainframe engineer, installation of other utilities will cost to company.
that seems a complicated process.
Last edited by arya_starc on Tue Oct 23, 2018 5:16 pm, edited 1 time in total.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Write VSAM file thru rexx

Postby arya_starc » Tue Oct 23, 2018 5:13 pm

expat wrote:The only way in which I have accessed VSAM within a REXX is by invoking IDCAMS.

It's O)K for a small number of records calls and updates, but most definitely not the way to go with many



In my case there are only few records, so I am going with the approach as you suggested but I am getting below error.



IDC4999I UABORT CODE 36                    
IEC130I AMSDUMP  DD STATEMENT MISSING      
IKJ56247I FILE INDD1 NOT FREED, IS NOT ALLOCATED      
IKJ56247I FILE OUTDD1 NOT FREED, IS NOT ALLOCATED    
IKJ56247I FILE SYSOUT NOT FREED, IS NOT ALLOCATED    
IKJ56247I FILE SYSPRINT NOT FREED, IS NOT ALLOCATED  
0
 
 



Below is the idcams utility code that I added in my rexx code


STMTV = "MY.TEST1.KE"                        
STMTP = "MY.TEST1.SE"                        
ADDRESS TSO                                              
SORTQ.1  = "  REPRO INFILE(INDSN) OUTFILE(OUTDSN) REPLACE"
"ALLOC FI(INDSN)    DSN('"STMTP"') SHR"                  
"ALLOC FI(OUTDSN)   DSN('"STMTV"') SHR"                  
"ALLOC DD(SYSIN) NEW REU RECFM(F B) LRECL(80)"            
"EXECIO 2 DISKW SYSIN (STEM SORTQ. FINIS"                
"CALL *(IDCAMS)"                                          
"FREE FI(INDD1)"                                          
"FREE FI(OUTDD1)"                                        
"FREE FI(SYSOUT)"                                        
"FREE FI(SYSPRINT)"                                      
"FREE FI(SYSIN)"                                          
SRTRC = RC                                                
say srtrc  
 
 



Thanks in advance.
arya_starc
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Write VSAM file thru rexx

Postby willy jensen » Tue Oct 23, 2018 6:07 pm

I wrote 'use the REPRO command', not IDCAMS.
Here is how:
ADDRESS TSO                                              
"ALLOC FI(INDD)    DSN('"STMTP"') SHR REUSE"                  
"ALLOC FI(OUTDD)   DSN('"STMTV"') SHR REUSE"  
"REPRO INFILE(INDD) OUTFILE(OUTDD) REPLACE"
"FREE FI(INDD OUTDD)"

Note that records must be sorted.
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Write VSAM file thru rexx

Postby willy jensen » Tue Oct 23, 2018 6:09 pm

Your program fails because you haven't allocated SYSPRINT. The other error messages are because the ddnames in the FREE commands differ from the ones ALLOCATED.

These users thanked the author willy jensen for the post:
arya_starc (Thu Oct 25, 2018 11:35 am)
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Write VSAM file thru rexx

Postby arya_starc » Thu Oct 25, 2018 11:35 am

Thanks Willy.
I got the expected result by using repro.
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post