Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

FORTRAN system routine

Go to solution
Alex Rauket
Occasional Contributor

FORTRAN system routine


I have a sneaking suspicion that the FORTRAN system routine only accepts character strings of a fixed length (like 40 or 80) although in all of the documentation I've read says nothing about it.

If anyone has had problems with the routine or has any tricks of the trade I'd love to hear them; I'm a new programmer and I need all the tricks I can get!

A. Clay Stephenson
Acclaimed Contributor

Re: FORTRAN system routine

Most implementations of the 3F system() function impose a 1023 character maximum length limit on the string. I suspect your problem is that you are not appending a NUL just past the last significant character.
If it ain't broke, I can fix that.
Gregory Fruth
Esteemed Contributor

Re: FORTRAN system routine

The man page for system(3f) says:

String can not be longer than NCARGS-50
characters, as defined in .

On my machine (HPUX 11.22, f90 2.8.6) NCARGS
appears to be 2048000. Check your value of