Hi Everyone,
I've been working on this relatively simple code for weeks and I'm unable to get it working properly. I recieve a CSV with about 15 data elements like below
Seattle, Lastname, Firstname, DOB, SEX, etc, etc
Seattle, Lastname, Firstname, DOB, SEX, etc, etc
Portland, Lastname, Firstname, DOB, SEX, etc, etc
Portland, Lastname, Firstname, DOB, SEX, etc, etc
Okay, you get the idea. There can be several to thousands so it's time consuming to enter this data to our mainframe server using an interface. I'd like to get this parsed in REXX so that I can automatically enter it on our mainframe interface. So far I have the following,
SOURCEFILE = "C:\DATA\DATA.TXT"
IF A=2 THEN DO COUNTER=1 TO LINES(SOURCEFILE)
PARSE VALUE LINEIN(SOURCEFILE) WITH CITY "," LAST_NAME "," FIRST_NAME "," MOM_NAME "," MIDDLE_NAME "," DAD_NAME "," DOB "," etc "," etc "," etc "," etc "," SEX "," etc "," etc
CALL SETCURSOR 4,23
CALL CREATEDATA
END
CREATEDATA:
CALL TYPE CITY
CALL PRESS TAB
CALL TYPE LAST_NAME
CALL PRESS TAB
CALL TYPE DATE(U)
CALL PRESS TAB
CALL TYPE FIRST_NAME
CALL PRESS TAB
CALL TYPE MOM_NAME
CALL PRESS TAB
CALL TYPE MIDDLE_NAME
CALL PRESS TAB
CALL TYPE DAD_NAME
CALL PRESS TAB
CALL TYPE DOB
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL PRESS TAB
CALL TYPE SEX
CALL PRESS TAB
CALL PRESS TAB
CALL PRESS TAB
CALL PRESS TAB
CaLL TYPE etc
CALL PRESS TAB
CALL PRESS TAB
CALL TYPE etc
CALL PRESS ENTER
RETURN
I know my function CREATDATA works because it actually types out the CITY as is and not the parsed value. I've tried using PARSE VAR LINEIN(DATA) etc with no luck. Anyone have any ideas on what I'm doing wrong here? Any help would be much appreciated. I'm going crazy trying to figure this out. Thanks in advance!
I've been working on this relatively simple code for weeks and I'm unable to get it working properly. I recieve a CSV with about 15 data elements like below
Seattle, Lastname, Firstname, DOB, SEX, etc, etc
Seattle, Lastname, Firstname, DOB, SEX, etc, etc
Portland, Lastname, Firstname, DOB, SEX, etc, etc
Portland, Lastname, Firstname, DOB, SEX, etc, etc
Okay, you get the idea. There can be several to thousands so it's time consuming to enter this data to our mainframe server using an interface. I'd like to get this parsed in REXX so that I can automatically enter it on our mainframe interface. So far I have the following,
SOURCEFILE = "C:\DATA\DATA.TXT"
IF A=2 THEN DO COUNTER=1 TO LINES(SOURCEFILE)
PARSE VALUE LINEIN(SOURCEFILE) WITH CITY "," LAST_NAME "," FIRST_NAME "," MOM_NAME "," MIDDLE_NAME "," DAD_NAME "," DOB "," etc "," etc "," etc "," etc "," SEX "," etc "," etc
CALL SETCURSOR 4,23
CALL CREATEDATA
END
CREATEDATA:
CALL TYPE CITY
CALL PRESS TAB
CALL TYPE LAST_NAME
CALL PRESS TAB
CALL TYPE DATE(U)
CALL PRESS TAB
CALL TYPE FIRST_NAME
CALL PRESS TAB
CALL TYPE MOM_NAME
CALL PRESS TAB
CALL TYPE MIDDLE_NAME
CALL PRESS TAB
CALL TYPE DAD_NAME
CALL PRESS TAB
CALL TYPE DOB
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL TYPE etc
CALL PRESS TAB
CALL PRESS TAB
CALL TYPE SEX
CALL PRESS TAB
CALL PRESS TAB
CALL PRESS TAB
CALL PRESS TAB
CaLL TYPE etc
CALL PRESS TAB
CALL PRESS TAB
CALL TYPE etc
CALL PRESS ENTER
RETURN
I know my function CREATDATA works because it actually types out the CITY as is and not the parsed value. I've tried using PARSE VAR LINEIN(DATA) etc with no luck. Anyone have any ideas on what I'm doing wrong here? Any help would be much appreciated. I'm going crazy trying to figure this out. Thanks in advance!