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.