Page 1 of 1

CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 3:57 am
by kumatae
Hello,

I truly apologize but I'm new to REXX and I can't seem to solve this problem. I tried google and search on this awesome forum but with no luck. My dilemma is that I have a list of comma separated values of biographical data in a file titled "FILEDATA.txt".

lastname, firstname, DOB
lastname, firstname, DOB
lastname, firstname, DOB
lastname, firstname, DOB
lastname, firstname, DOB

I need to use REXX to "read" the file and enter it to a mainframe database. So far I have the following and I'm not sure if I'm on the right path or not.

/* REXX */
INFILE = "C:\FILEDATA.TXT"
IF READSCREEN(1,2,6) = "CIMDTL" THEN DO COUNTER=1 TO LINES(INFILE)
CALL SETCURSOR 4,6
PARSE INFILE LAST_NAME, FIRST_NAME, DOB
CALL CREATEAFILE
END

CREATEAFILE:
CALL TYPE LASTNAME
CALL PRESS TAB
CALL TYPE FIRSTNAME
CALL PRESS TAB
CALL PRESS TAB
CALL TYPE DOB
CALL PRESS TAB
CALL TYPE DATE(U)
RETURN

There is also a field for today's date and I think "DATE(U)" inputs it the way it needs to be. I'm pressing TAB to move one field to the next. I do the opposite where we scan the database and gather data into a text file so this is bit new for me.
My question is, I think this would handle the first line, but how would it handle the lines after that? Do I use a loop? Does this even look anything remotely close to what I want to do? Do I even need to PARSE? Any help would be much appreciated. Thank you in advance.

Re: CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 4:09 am
by BillyBoyo
Your Rexx is not running on the Mainframe (we have no C: drives) and you are trying to enter data through the emulator to a normal user "input screen" to make the updates?

Re: CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 6:46 am
by kumatae
yes that is correct. I'm using an user interface to the mainframe.

Re: CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 7:16 am
by dick scherrer
Hello and wecome to the forum,

I'm having trouble finding a mainframe question here :?

Please clarify where there is a mainframe doubt.

Re: CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 11:38 am
by enrico-sorichetti
So far I have the following and I'm not sure if I'm on the right path or not.

all depends on the REXX you are using

NOTHING of what You showed will ever work on a <standard> REXX interpreter
Open Object Rexx and /or Regina Rexx

might work with Reginald Rexx or with Kilowatt Software ROO
with all their NON STANDARD extensions

the chances of getting help anywhere for the last two are almost non existent

Re: CSV to Mainframe database

PostPosted: Fri Apr 05, 2013 6:15 pm
by NicC
And so you should look there. Locked.