CSV to Mainframe database



IBM's Command List programming language & Restructured Extended Executor

CSV to Mainframe database

Postby kumatae » Fri Apr 05, 2013 3:57 am

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.
kumatae
 
Posts: 2
Joined: Fri Apr 05, 2013 2:21 am
Has thanked: 0 time
Been thanked: 0 time

Re: CSV to Mainframe database

Postby BillyBoyo » Fri Apr 05, 2013 4:09 am

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: CSV to Mainframe database

Postby kumatae » Fri Apr 05, 2013 6:46 am

yes that is correct. I'm using an user interface to the mainframe.
kumatae
 
Posts: 2
Joined: Fri Apr 05, 2013 2:21 am
Has thanked: 0 time
Been thanked: 0 time

Re: CSV to Mainframe database

Postby dick scherrer » Fri Apr 05, 2013 7:16 am

Hello and wecome to the forum,

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

Please clarify where there is a mainframe doubt.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: CSV to Mainframe database

Postby enrico-sorichetti » Fri Apr 05, 2013 11:38 am

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: CSV to Mainframe database

Postby NicC » Fri Apr 05, 2013 6:15 pm

And so you should look there. Locked.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post