Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output question

Status
Not open for further replies.

ddstar

IS-IT--Management
Jun 2, 2008
4
US
Hey guys / gals,

Just have a simple question I'm sure is completely easy to most.

We have a procedure that dumps data to a .txt file via comma delimination

Something like this:

Output to file.txt
Export delimiter "," <data here>

The problem is the file does not store a record (row) on a single line, rather it ends the line with a weird block-like character and continues to dump the data. We would like to have it send a new-line break at the end of a row.

We are exporting from Solaris to Windows OS.

Secondly.. if I was to run a progress procedure from the unix command prompt how would I go about doing that (we have a multi-user if that matters)

Something like this?

/path/to/mbpro -pf preference.pf -p procedure.p

or:

RUN procedure.p

????

Thanks for all your help!
-ddstar
 
ddstar,
for your first question - it's because you are going from a *nix os to windows. if you ftp the file from the solaris box to windows you should see it properly. you fould also use the unix2dos utility.
for your second question do you want to run as a cron (scheduled) job or do you want to run interactively?
regards,
longhair
 
Well we are running the procedure from a solaris machine and it is putting the file on a shared drive on the network (windows based).

So.. we should run the procedure save it on the linux box and use.. OS-COMMAND SILENT unix2dos and than copy it to the shared folder?

Yes, we are trying to do a cron job command to run a procedure and no it would be in silent mode and quit when it was done doing the procedure.

Thanks man,
ddstar
 
ddstar,
this will happen on the set up that you have.
you have 2 options:
1 save it on the *nix box
then use unix2dos to convert
then copy to the windows box
2 save it on the *nix box
then use an ftp program (reflections, dos, etc.) to ftp the
file to the windows box
most, if not all ftp programs, compensate for the lack <cr> in the *nix environment.
regards,
longhair
 
longhair:

we added this to the procedure:

OS-COMMAND SILENT unix2dos FileName.txt

and it worked great...

Do you have any input on adding this procedure as a cron job?

Thanks!
 
Most 'cron' problems result from the fact that 'cron' does not supply the same environment variables as an interactive shell.

Place your 'mbpro' command in a shell script where you also set up the necessary environment variables, especially DLC, PROPATH, and PATH. You should re-direct standard output and standard error to a log file, or 'cron' will route it to mail.

Then setup your 'cron' job to run the shell script.

 
How about:

# run /path/to/procedure.p

Sounds simple enough..
 
The 'run' statement is not a UNIX command, it's a PROGRESS statement, and is only valid inside a PROGRESS procedure or in the PROGRESS procedure editor.

Your cron script must use 'mbpro'.

Here is a specific example I have running on my HP-UX system. The 'cron' entry, runs Tuesday thru Saturday mornings, re-directing output to a file:
Code:
30 01 * * 2-6 /usr/libsys/locchek.job >/etc/locchek 2>&1

This is the '/usr/libsys/locchek.job' script:
Code:
cd /usr/libsys
/usr/dlc/bin/mbpro data/freedom -yy 1980 -e 63 -D 60 -l 4000 -p inv/locchek.p
Note that 'mbpro' is invoked with its full path, and the database reference ('data/freedom') and procedure reference ('inv/locchek.p') are pathed relative to the '/usr/libsys' directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top