Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Rexx how can I read and write to a member 3

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I'm trying to read a record from a member (Like "This is a Test), and then write the record to a new member. However, it seems that the Rexx code converts the text into upper case (Like "THIS IS A TEST"). How can this be avoided?
 
Without seeing your code it is difficult to say precisely, but as you mention "member" then you are presumabely using an MVS system. If that is the case, then I assume you read in the member with EXECIO and place the data on the data stack (i.e. you do not use the STEM operand on the EXECIO). I further assume that you then read from the stack with PULL. PULL is an abbreviation for PARSE UPPER PULL with converts your data to uppercase. To preserve the case, replace your PULL with PARSE PULL, i.e. no UPPER.

Hope this helps.
 
No se si estan haciendo algun tratamiento con los registros despues de leerlos.Pero aqui tienes un ejemplo
___ English
I dont Know if you are doing something with the records after read, but i´ve a little example.

/* REXX */

'ALLOC DA(PSTAT06.IPM.LISTADOS(ENTRADA)) FI(ENT) '
'ALLOC DA(PSTAT06.IPM.LISTADOS(SALIDA)) FI(SAL) '
'EXECIO * DISKR ENT(FINIS STEM DUMMY.'
DO I=1 TO DUMMY.0
SAY ' RECORD < 'STRIP(DUMMY.I)' >'
END
'EXECIO * DISKW SAL(FINIS STEM DUMMY.'
'FREE FI(ENT SAL)'

I have tested it before.
 
If you are doing a read/write to a PS, you can simply use a diposition of MOD and do normal R/W using the EXECIO command

Reading from PS

&quot;ALLOC DA('A.B.C') FI(DD1) MOD&quot;
&quot;EXECIO * DISKR DD1 (STEM NUM. FINIS)&quot;

here the stem variable NUM gets populated where NUM.0 contains the total number of records fetched. NUM.1 , NUM.2 , ...so on contains the actual records

Writing to PS

&quot;ALLOC DA('A.B.C') FI(DD2) MOD&quot;
NUM.1 = &quot;THIS IS FIRST LINE&quot;
NUM.2 = &quot;THIS IS SECOND LINE&quot;
&quot;EXECIO * DISKW DD2 (STEM NUM. FINIS)&quot;

Because you have used dispostion of MOD, the existing records won't be overwritten but the new ones get appended to old ones

In case of PDS members, you can't use the dispotion of MOD as it gives back some ERROR. So you have to read the whole file into a stem variable(or stack)and write back the stem to the member. Now any consecutive write will start appending the records instead of overwriting the old ones...

Here, i have a code for doing that

ADDRESS TSO
&quot;FREE DDN(INDD)&quot;
&quot;ALLOC DA('A.B.C(ABC)') FI(INOUT)&quot;
&quot;EXECIO * DISKR INOUT (STEM DUMMY. FINIS)&quot;
&quot;EXECIO * DISKW INOUT (STEM DUMMY.)&quot;
TEXT.1 = &quot;I AM FEELING GREAT NOW&quot;
&quot;EXECIO * DISKW INOUT (STEM TEXT. FINIS)&quot;

This might probably help you

good luck and have fun!
Ashish


 
Hi all,

I have some data in a GDG, everyday a new generation is created. So when I read this GDG everyday via a REXX routine I need to pick up the latest version of the GDG, how can this be accomplished..

Let us assume the GDG base as AT.SAMP.GDG.TEST.


Many thanks,
Saddo
 

--OUTTRAP to set up a trap for the LISTC output

--LISTC LVL() to get the full names of all the GDG generations

Once you have the catalog list in the trap, you can read it from the bottom up to find the latest generation.




Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top