RE: PhP e COBOL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sure,

1.  In PHP/Mysql extract rows and save them to a file in delimited fashion,
for numeric values be sure to align all the number digits (cobol is
dependent on numeric fields being aligned), you can do this with 

sprintf("%09.02f",$dbfloat);

Your delimiter character can be any character that is not a part of any of
your data, I tend to favor the vertical bar "|".

2.  FTP the file to the system with COBOL (I am assuming mainframe but it
doesn't matter) using a character transfer type which will convert all ascii
characters to their EBCDIC equivalants.  Most mainframe systems support
tcp/ip (required for ftp), and if your shop uses products like NDM (network
data mover), look closely, ftp is actually doing the transfer between
unix/mainframe in the guise of NDM.  Your mainframe TSO id/password should
be all that is needed to do the transfer, and yes, it can occur while you
are signed on.

NOTE: assuming IBM Mainframe, if you do second FTP connection and use the
"SITE JES" command, and follow that with a GET filename where filename on
the mainframe contains execution JCL, the JOB will be submitted if your id
has sufficient access, and FTP is supposed to wait until the job is complete
and transfer the JES output back to your server file.  In my shop this
tranfer back part doesn't work (perhaps I'm not using the right SYSOUT
class, not sure), so I cause all the output from my job to go to a physical
file on the mainframe, but because the wait part works, I can then establish
another FTP connection (after the job has completed and without the SITE
command), and "GET" the file left behind by the job.

3.  In COBOL, read a variable length record from the transferred file and
UNSTRING the record contents into your element definitions, delimited by
your delimiter character above.  You may have to UNSTRING numeric values
into a PIC X(?) data element first, and then do a second UNSTRING to break
apart the digits to the left or to the right of the decimal.  Now you are
free to do what you need to with the data in COBOL.

Good luck,

Warren Vail
 


> -----Original Message-----
> From: Andre [mailto:andre_caridade@xxxxxxx] 
> Sent: Saturday, November 20, 2004 6:56 AM
> To: php-general@xxxxxxxxxxxxx
> Subject:  PhP e COBOL
> 
> 
> Hello 
> 
> I need some help in this subject php + COBOL.
> I need to load data of a program in COBOL for a site written in php. 
> The data must be loaded for a DB in mysql. 
> Any one knows as I make this.
> Thank for the help
> 
> André Caridade
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux