Writing into Sequential file on Unix Solaris
Jonbickel@aol.com
Jonbickel@aol.com
Tue, 29 Apr 2003 08:38:03 -0400
Sagar,
Here's a very basic example of creating a command file on the fly. If this is more basic than you intended, I apologize for misinterpreting.
$: setenv mycomfile $home/comfile.com
$: quiz
Q U I Z (PowerHouse 8.23.D7)
Copyright 2001 COGNOS INCORPORATED
Licensed PH8-UNIX-RUNTIME-W-REPORTING for customer: 5038860001 U. S.
FILTER/ENVIREX HU
> define d_line1 char*40 = "#!/bin/csh"
> define d_line2 char*40 = "echo 'testing...'"
> define d_line3 char*40 = "exit"
> set report device disc name $mycomfile
> report d_line1 skip d_line2 skip d_line3
> set page length 4
> set page nohead
> go
> exit
$: mv $mycomfile.txt $mycomfile
$: ls $mycomfile
$: chmod 777 $mycomfile
$: $mycomfile
testing...
A quick screen could refer to the script via
RUN COMMAND "$mycomfile"
and then delete it via
RUN COMMAND "rm $mycomfile"
This is done in/for c-shell on HP-UX, so your command line syntax may vary slightly if you are using a different interpreter. The environment variable ($mycomfile in this case) can be manipulated in a manner similar to a logical in VMS.
Hope this helps!
Jon
P.s., don't listen to Blue knocking down UNIX. It's a fine powerful OS that I've come to like working with better than VMS - It's just a little obscure and counter-intuitive at the beginning... :-)
>
> --__--__--
>
> Message: 7
> From: "Edis, Robert" <Robert.Edis@blistex.com>
> To: "'powerh-l@lists.swau.edu'" <powerh-l@lists.swau.edu>
> Subject: RE: Writing into Sequential file on Unix Solaris Powerhouse envir
> onme nt
> Date: Mon, 28 Apr 2003 15:58:33 -0500
>
> Sagar
>
> OpenVMS RMS files contain an explicit <CR><LF> at the end of each record so
> that any program knows the end of a record. OpenVMS supports both fixed and
> variable length records.
>
> UNIX only support fixed length records and the <CR><LF> is implied. VI
> recognises EOL and displays the file correctly but most other programs wont.
> You fix this by manually inserting a <CR><LF> at the end of each record.
> You may only need the <CR> depending on what program is going to read the
> file.
>
> My sympathies on having to move from low cost, user friendly OpenVMS to high
> cost, unfriendly UNIX!
>
> Regards,
> Blue
>
> -----Original Message-----
> From: Goparaju, Vidyasagar [mailto:VGoparaju@tradepointsystems.com]
> Sent: Monday, April 28, 2003 3:38 PM
> To: 'powerh-l@lists.swau.edu'
> Subject: Writing into Sequential file on Unix Solaris Powerhouse
> environme nt
>
>
> Hi All,
>
> I am in the process of migrating my
> Powerhouse Application on VMS to Unix Solaris under Oracle environment.
>
> We left the sequential files within the
> Powerhouse dictionary. Because the physical files for these records are
> created during the runtime to create command procedures.
>
> I have a GENERIC 80 characters sequential
> file.
>
> 1. I have created physical file using QUITL (There is not equivalent to
> CREATE/FDL on Unix environment. May be I don't know).
> 2. Written all the commands into the GENRIC.dat file from QUICK.
> a. Quiz << exit
> b. Exec $MLT/SYCUSLST nogo
> c. Set rep dev disc name sycuslst
> d. Set nobl
> e. Go
> f. <parm>
> g. <parm>
> h. exit
> 3. On VMS the file looks like line sequential. But on Unix system
> everything is one long string.
> 4. Only "more" command is showing this file line by line. I could not
> open it using VI.
> 5. If I create the above command procedure using VI editor manually. It
> is working fine. But I could not make it to work when I create it from
> QUICK.
>
> My objective is:
> 1. Create a sequential file with similar attributes to GENERIC with
> name <prog id>+date+time.sh
> 2. Write commands and parameters into it using Powerhouse QUICK
> program.
> 3. Execute the command procedure from QUICK and delete the command
> procedure when the report is created.
> 4. Above procedure is already working on VMS system. I am trying to
> migrate the same function to UNIX environment.
>
> Please help.
>
> Thanks
> Sagar
>