RE: [U2] openseq question

2006-01-05 Thread Jeff Powell
Thank you all. It is working now with the VOC pointer. It is much
simpler now that I don't care what account I'm in.

One final question. 

I have downloaded many of the pdfs ( UniBasic command ref., Using
unidata, SB+ Solutions, ...) from the IBM site but where is this
documented? Are there any books ( online or otherwise ) that a novice to
unidata programming could refer to in cases like this? What I've looked
at so far is more like a quick reference and doesn't really dive into
detail. For example the difference handling absolute-path and VOC
pointer with using the full path vs. path,rec-id approach.


Thanks again,

Jeff


On Wed, 2006-01-04 at 19:04 -0700, Kevin King wrote:

 Jeff, if the VOC entry is MFG.DATA.IPS.TMP then the OPEN is:
 
 OPEN MFG.DATA.IPS.TMP, MTR.REC TO ...
 
 Not the concatenated thing you had in your post.
 
 -K
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-05 Thread Allen E. Elwood
Gaaa!  no...most of the files I've uploaded were measly little files.  Tiny,
little itty bitty files.  Like specs on the wall small.  Mostly forecast
files where you just have 12 three to four char qty's for a couple thousand
parts.

And you gotta realize that people get used to their graphs.  In the
corporate world people like warm and fuzziesstuff that costs a lot of
system resources and adds no value but makes them feel good.  So they get to
see that the upload is going to take ten minutes so off to the break room
they go.  And yesI can guarantee that the files will be small because
the company doesn't exist any more ;)

Warm and fuzzies.  I had a morning report that I spent probably close to
1000 hours on, that would break out projections for the end of the month and
compare it to budget and do crazy stuff like show how much more warehouses
had to ship, or how much less to make the projection for the EOM.  Like, as
if seeing the shortage at the end of the month would make the customers
order more

Butit made the guy setting in the top floor at the big desk feel good.
Total waste of time, but he felt good.  Company is gone now, but he felt
good.

*

==
SCREEN.GRAPH:
  DONE.PCT=INT(((RECORDS.READ*100)/SELECTED)+.5)
  SMSG=DONE.PCT:' Percent Done, ':RECORDS.READ:' Records Read out of
':SELECTED:' selected'
  CC=40-(INT(LEN(SMSG)/2))
  CRT L(10):C(CC):SMSG:EOL
  DONE.CNTR=INT((DONE.PCT*60+50)/100)
  CRT L(12):C(10):STR(LX,DONE.CNTR)
  CRT L(13):C(10):STR(LX,DONE.CNTR)
  SMSG='Projected Finish Time :
':OCONVTIME()-WAS)/DONE.PCT)*100)+WAS,'MTHS')
  CC=40-(INT(LEN(SMSG)/2))
  CRT L(15):C(CC):SMSG:EOL
  SMSG='Current Time : ':OCONV(TIME(),'MTHS')
  CC=40-(INT(LEN(SMSG)/2))
  CRT L(16):C(CC):SMSG:EOL
  CRT L(20):C(1):
RETURN
* =
ACTUAL.FINISH.TIME:
  SMSG='Actual Finish Time : ':OCONV(TIME(),'MTHS')
  CC=40-(INT(LEN(SMSG)/2))
  CRT L(17):C(CC):SMSG:EOL
  CRT L(20):C(1):
RETURN
*

==

Allen E. Elwood
www.tortillafc.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Timothy Snyder
Sent: Wednesday, January 04, 2006 19:12
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] openseq question


Allen E. Elwood wrote on 01/04/2006 01:29:47 PM:

 I've always found it helpful to open the file/record in 'regular' mode
first
 to find out if the directory entry worked or possibly to write a null
record
 if it didn't.

So, if the O/S-level file is multi-megabytes, you're reading the whole
thing into memory?  That could cause problems with shared memory and will
certainly create a burden on the system.  It also kind of defeats the
purpose of using a sequential file, since you're reading the whole thing
in, then opening it again and reading through the entire file a second
time with READSEQ.  Since you've incurred the memory and performance hit
to pull the whole thing into a variable, you might as well waltz through
that variable to extract the lines an attribute at a time with REMOVE or
READNEXT.

If you're following this practice only on small files, and only
infrequently, it's probably OK, but how can you guarantee that will always
be the case?


Tim Snyder
Consulting I/T Specialist , U2 Professional Services
North American Lab Services
DB2 Information Management, IBM Software Group
717-545-6403
[EMAIL PROTECTED]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Brian Leach
Jeff,

AFAIR OpenSeq on UniData looks for either a path name, or if you specify an
item id it looks for an item in a directory file (not a path). 

So you would need to either

A) OPENSEQ /tmp/ : MTR.REC TO F.MTR.ROW.FILE ... 

Or

B) create a file pointer to /tmp (e.g. named TMP) and then
 OPENSEQ TMP,MTR.REC TO F.MTR.ROW.FILE ...

Brian

 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Powell
 Sent: 04 January 2006 14:31
 To: u2 users group
 Subject: [U2] openseq question
 
 Happy New Year.
 
 I am having trouble with the openseq function in UniData. We 
 are operation in Pick mode.
 
 Openseq can't find the specified file at path,filename. Is 
 there an assumed prefix?
 
 Here is the code frag that is failing.
 
 MTR.FILE.PATH='/tmp'
 OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
   EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
   OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE 
 CALL SB.DISP(3,TROUBLE OPENING
 :MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
 GO PGM.EXIT
   END
 END
 
 Thanks,
 
 Jeff
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Baakkonen, Rodney A (Rod) 46K
Is it a permissions problem?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeff Powell
Sent: Wednesday, January 04, 2006 8:31 AM
To: u2 users group
Subject: [U2] openseq question


Happy New Year.

I am having trouble with the openseq function in UniData. We are
operation in Pick mode.

Openseq can't find the specified file at path,filename. Is there an
assumed prefix?

Here is the code frag that is failing.

MTR.FILE.PATH='/tmp'
OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
  EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
  OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE OPENING
:MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
GO PGM.EXIT
  END
END

Thanks,

Jeff
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Piers Angliss
Jeff,

I think Openseq looks either for a fully specified path to the file as in :
OPENSEQ /tmp/recordname TO F.MTR.ROW ELSE

or it understands the filename, recordname construct but looks for the
filename in the VOC, as in

OPENSEQ TMPFIL, recordname to F.MTR.ROW ELSE...
where TMPFIL is a DIR type VOC entry pointing to /tmp

but it can't cope with your construct which is effectively
OPENSEQ '/tmp', recordname

hth

Piers

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeff Powell
Sent: 04 January 2006 14:31
To: u2 users group
Subject: [U2] openseq question


Happy New Year.

I am having trouble with the openseq function in UniData. We are
operation in Pick mode.

Openseq can't find the specified file at path,filename. Is there an
assumed prefix?

Here is the code frag that is failing.

MTR.FILE.PATH='/tmp'
OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
  EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
  OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
CALL SB.DISP(3,TROUBLE OPENING
:MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
GO PGM.EXIT
  END
END

Thanks,

Jeff
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Jeff Powell
No. /tmp is an absolute path.


On Wed, 2006-01-04 at 09:47 -0500, Koser, Mike wrote:

 Jeff
 Is '/tmp' in the VOC?
 Mike
 
 
 -Original Message-
 From: Jeff Powell [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 04, 2006 9:31 AM
 To: u2 users group
 Subject: [U2] openseq question
 
 
 Happy New Year.
 
 I am having trouble with the openseq function in UniData. We are
 operation in Pick mode.
 
 Openseq can't find the specified file at path,filename. Is there an
 assumed prefix?
 
 Here is the code frag that is failing.
 
 MTR.FILE.PATH='/tmp'
 OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
   EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
   OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE 
 CALL SB.DISP(3,TROUBLE OPENING
 :MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
 GO PGM.EXIT
   END
 END
 
 Thanks,
 
 Jeff
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
 
 __
 This e-mail has been scanned by MCI Managed Email Content Service, using
 Skeptic(tm) technology powered by MessageLabs. For more information on MCI's
 Managed Email Content Service, visit http://www.mci.com.
 __
 
 __
 This e-mail has been scanned by MCI Managed Email Content Service, using 
 Skeptic(tm) technology powered by MessageLabs. For more information on MCI's 
 Managed Email  Content Service, visit http://www.mci.com.
 __
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/

Jeff Powell

IT Manager
Industrial Piping Specialists
606 N. 145th Ave. E.
Tulsa, OK 74166
(918) 270-6311
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread colin.alfke
Your syntax is a little off. When you use the seq.file.name, record.id
syntax then seq.file.name has to be a dir type file. You will have to
either create a voc entry for /tmp, eg.:

TMP.DIR
001 DIR
002 /tmp
003 D_VOC

And then you should be able to: MTR.FILE.PATH = TMP.DIR

Or you can OPENSEQ MTR.FILE.PATH:/MTR.REC

Hth
Colin Alfke
Calgary Canada

-Original Message-
From: Jeff Powell

Happy New Year.

I am having trouble with the openseq function in UniData. We 
are operation in Pick mode.

Openseq can't find the specified file at path,filename. Is 
there an assumed prefix?

Here is the code frag that is failing.

MTR.FILE.PATH='/tmp'
OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
  EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
  OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE OPENING :MTR.FILE.PATH:/:MTR.REC:
[E:STATUS():])
GO PGM.EXIT
  END
END

Thanks,

Jeff
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Bob Woodward
You need to have MTR.FILE.PATH open as a file handle, first.  You can do
one of the following:

MTR.FILE.PATH='/tmp'
OPEN MTR.FILE.PATH TO MTR.FILE ELSE STOP
MTR.REC = 'RECID'
OPENSEQ MTR.FILE,MTR.REC TO F.MTR.ROW.FILE ELSE
  [what you already have]
END

Or open the full path directly:

MTR.FILE.PATH='/tmp'
MTR.REC='RECID'
OPENSEQ MTR.FILE.PATH:'/':MTR.REC TO F.MTR.ROW.FILE ELSE
  [what you already have]
END

BobW
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jeff Powell
Sent: Wednesday, January 04, 2006 6:31 AM
To: u2 users group
Subject: [U2] openseq question

Happy New Year.

I am having trouble with the openseq function in UniData. We are
operation in Pick mode.

Openseq can't find the specified file at path,filename. Is there an
assumed prefix?

Here is the code frag that is failing.

MTR.FILE.PATH='/tmp'
OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
  EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
  OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE OPENING
:MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
GO PGM.EXIT
  END
END

Thanks,

Jeff
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Kevin King
I've actually had problems with various versions of Unidata and
CLOSESEQ releasing the file when opening a full path.  Opening under a
VOC DIR-pointer has never exhibited that problem, so I'd recommend the
VOC pointer approach over using a full path.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Dana Baron
Several years ago I created a little utility to open sequential files as
needed. It's pretty robust; hasn't given me much trouble over the years.
Like Kevin, I've had problems with the full path version of openseq, so my
utility converts full path mode to VOC pointer mode and creates the VOC
pointer if it doesn't already exist.

I'll include it below and attach it in text form.

Dana Baron
System Manager
Smugglers' Notch Resort


SUBROUTINE OPEN_UNIX_FILE (UNIX.FN, MODE, UNIX.FILE, ERR.CODE)
!**
!   SYSTEM: AHS
!   MODULE: UTILITY
!   PROGRAM:OPEN_UNIX_FILE
!
!   DESCRIPTION:This subroutine opens a sequential file. Sequential
!   files can be used to export Unidata data to UNIX.
!
!   Notes:  The parameters passed to this routine are:
!
!   UNIX.FN   - the full file name of the file to open.
!   MODE  - expects the following choices:
!   C - create a new file
!   U - update existing file (error message if not there)
!   UC- update the file if it exists, create a new file if
!   it doesn't exist.
!   UNIX.FILE - the file reference num returned to calling program
!   ERR.CODE - Error code to indicate results as follows:
!   0 = No error. Everthing is OK.
!   1 = (Fatal) Can't open the VOC item for the directory
!   2 = (Info) VOC item for directory already defined
!   3 = (Info) In C mode, file exists so renamed
!   4 = (Warning) In U mode, file does not exist
!   5 = (Fatal, calling program bug) Invalid mode parameter
!
!**
!   MODIFICATION HISTORY
!
! EDIT DATE WHO REASON/DESCRIPTION
!
! 07/12/96  GDB Created
!
! 11/14/97  GDB Added UC mode to update file if it exists, create
!   the file if it doesn't exist.
!
! 02/15/01  GDB Copied OPEN_VMS_FILE to OPEN_UNIX_FILE and modified
!   to work in Unix as part of conversion from VMS to Unix.
!**

TRUE = 1
FALSE = 0
ERR.CODE = 0

OPEN ,VOC TO VOC.FILE ELSE
PRINT CANT OPEN VOC!!!
ERR.CODE = 1
ABORT
END
!DEBUG
NUM.SLASH = DCOUNT(UNIX.FN, /)
UNIX.DIR = 
UNIX.ID = FIELD(UNIX.FN,/,NUM.SLASH)
FOR II = 2 TO NUM.SLASH - 1
UNIX.DIR = UNIX.DIR : / : FIELD(UNIX.FN,/,II)
NEXT II

VOC.ITEM = DIR:@AM:UNIX.DIR
READ TEST.ITEM FROM VOC.FILE , UNIX.DIR THEN
IF (TEST.ITEM2) = UNIX.DIR THEN
NULL
END ELSE
PRINT VOC ITEM ':UNIX.DIR:' DEFINED IN VOC AS  :
PRINT '' : TEST.ITEM : ''
ERR.CODE = 2
END
END ELSE
WRITE VOC.ITEM ON VOC.FILE , UNIX.DIR
END

BEGIN CASE
CASE MODE = C
PASS = 1
RENAME = FALSE
DONE = 0
NEW.UNIX.ID = UNIX.ID
LOOP UNTIL DONE DO
OPENSEQ UNIX.DIR, NEW.UNIX.ID TO UNIX.FILE THEN
PRINT FILE ALREADY EXISTS...RENAMING
NEW.UNIX.ID = UNIX.ID : _ : PASS
RENAME = TRUE
PASS = PASS + 1
ERR.CODE = 3
END ELSE
DONE = 1
END
REPEAT
IF RENAME = TRUE THEN
PRINT FILE RENAMED TO  : NEW.UNIX.ID
END

CASE MODE = U
DONE = 0
OPENSEQ UNIX.DIR, UNIX.ID TO UNIX.FILE ELSE
PRINT FILE DOES NOT EXIST
ERR.CODE = 4
END

CASE MODE = UC
DONE = 0
OPENSEQ UNIX.DIR, UNIX.ID TO UNIX.FILE ELSE
! File doesn't exist. A new file is created
END

CASE -1
PRINT Function called with a bad Mode parameter.
ERR.CODE = 5
END CASE

RETURN
SUBROUTINE OPEN_UNIX_FILE (UNIX.FN, MODE, UNIX.FILE, ERR.CODE)
!**
!   SYSTEM: AHS
!   MODULE: UTILITY
!   PROGRAM:OPEN_UNIX_FILE
!
!   DESCRIPTION:This subroutine opens a sequential file. Sequential
!   files can be used to export Unidata data to 

RE: [U2] openseq question

2006-01-04 Thread Allen E. Elwood
I've always found it helpful to open the file/record in 'regular' mode first
to find out if the directory entry worked or possibly to write a null record
if it didn't.

I like to have a graph display, and this way I can tell how many 'records'
(or AMCs in this case) I'm going to be processing so I can display the
forecasted time of completion.

 READ TRANSFER.REC FROM TRF, 'AKSS.FCST' ELSE
   SS='Attention, this function was unable to retrieve the Forecast file '
   SS:='from the net - Now Aborting Function!;b;e;a;c;h'
   CALL SCREEN.MSG(SS)
   GOTO Programmed_Abort
 END
 OPENSEQ TRANSFER, AKSS.FCST READONLY TO TRF.SEQ ELSE
   SS='This function was unable to access a record that was just written to
'
   SS='the TRANSFER directory. As a result, it cannot continue '
   SS='- now aborting!;b;c;h'
   CALL SCREEN.MSG(SS)
   GOTO Programmed_Abort
 END
 NBR.OF.ATTRS=DCOUNT(TRANSFER.REC,@AM)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Jeff Powell
Sent: Wednesday, January 04, 2006 06:31
To: u2 users group
Subject: [U2] openseq question


Happy New Year.

I am having trouble with the openseq function in UniData. We are
operation in Pick mode.

Openseq can't find the specified file at path,filename. Is there an
assumed prefix?

Here is the code frag that is failing.

MTR.FILE.PATH='/tmp'
OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
  EXECUTE '!touch ':MTR.FILE.PATH:/:MTR.REC
  OPENSEQ  MTR.FILE.PATH, MTR.REC TO F.MTR.ROW.FILE ELSE
CALL SB.DISP(3,TROUBLE OPENING
:MTR.FILE.PATH:/:MTR.REC: [E:STATUS():])
GO PGM.EXIT
  END
END

Thanks,

Jeff
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Bob Woodward
Hi Kevin

Do you recall which OS this was on?  I don't believe I've run into this
problem but I'm currently using Windows (2000 and 2003) but I've also
been on RS6000 and DG/UX.  All of this is with UV.

Thanks.

BobW
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin King
Sent: Wednesday, January 04, 2006 9:36 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] openseq question

I've actually had problems with various versions of Unidata and
CLOSESEQ releasing the file when opening a full path.  Opening under a
VOC DIR-pointer has never exhibited that problem, so I'd recommend the
VOC pointer approach over using a full path.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Jeff Powell
Thank you for all your helpful suggestions.

I am now looking at creating a VOC pointer as Kevin suggests below.
Actually I'll need to create two pointers one for the TEST account and
another for the LIVE account.

I had originally tried the PATH:FILE syntax before I found out that the
file needed to exist before it could be opened. So I went to the other
syntax hoping to resolve the non-existant file issue.

Here is the current function without the VOC pointer.

GOSUB GET.MTR.COUNTER
MTR.REC=MTR:OCONV(DATE(),D2/):OCONV(MTR.CTR,MR%4):.ROW
CONVERT / TO  IN MTR.REC
MTR.FILE.PATH='/tmp/MFG.DATA.IPS'
IF @PATH = /ud/TEST THEN
MTR.FILE.PATH=MTR.FILE.PATH:'.TEST'
END
MTR.FILE.PATH=MTR.FILE.PATH:'/tmp/'
OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE
EXECUTE '!touch ':MTR.FILE.PATH:MTR.REC
OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE OPENING
:MTR.FILE.PATH:MTR.REC: [E:STATUS():])
GO PGM.EXIT
END
END
WRITESEQ LASTREC APPEND ON F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE WRITING TO
:MTR.FILE.PATH:MTR.REC [E:STATUS():])
GO PGM.EXIT
END
CLOSESEQ F.MTR.ROW.FILE
RETURN

Thanks again.


On Wed, 2006-01-04 at 10:35 -0700, Kevin King wrote:

 I've actually had problems with various versions of Unidata and
 CLOSESEQ releasing the file when opening a full path.  Opening under a
 VOC DIR-pointer has never exhibited that problem, so I'd recommend the
 VOC pointer approach over using a full path.
 
 -Kevin
 [EMAIL PROTECTED]
 http://www.PrecisOnline.com
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Kevin King
Do you recall which OS this was on?  I don't believe I've run into
this problem but I'm currently using Windows (2000 and 2003) but I've
also been on RS6000 and DG/UX.  All of this is with UV.

Unidata on Windows, as I recall.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread colin.alfke
Jeff;

I use a VOC pointer for exactly this reason. It doesn't matter which
account/where the directory is - I just need the VOC pointer that points
to it. It makes it really easy to transfer from TEST to LIVE.

Also, as Tim pointed out, you don't need the file to exist to open it.
In fact, I have a bunch of export routines that throw an error if the
file exists when it opens it.

Hth
Colin Alfke
Calgary Canada 

-Original Message-
From: Jeff Powell

Thank you for all your helpful suggestions.

I am now looking at creating a VOC pointer as Kevin suggests below.
Actually I'll need to create two pointers one for the TEST 
account and another for the LIVE account.

I had originally tried the PATH:FILE syntax before I found out 
that the file needed to exist before it could be opened. So I 
went to the other syntax hoping to resolve the non-existant file issue.

Here is the current function without the VOC pointer.

GOSUB GET.MTR.COUNTER
MTR.REC=MTR:OCONV(DATE(),D2/):OCONV(MTR.CTR,MR%4):.ROW
CONVERT / TO  IN MTR.REC
MTR.FILE.PATH='/tmp/MFG.DATA.IPS'
IF @PATH = /ud/TEST THEN
MTR.FILE.PATH=MTR.FILE.PATH:'.TEST'
END
MTR.FILE.PATH=MTR.FILE.PATH:'/tmp/'
OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE
EXECUTE '!touch ':MTR.FILE.PATH:MTR.REC
OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE OPENING 
:MTR.FILE.PATH:MTR.REC: [E:STATUS():])
GO PGM.EXIT
END
END
WRITESEQ LASTREC APPEND ON F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE WRITING TO 
:MTR.FILE.PATH:MTR.REC [E:STATUS():])
GO PGM.EXIT
END
CLOSESEQ F.MTR.ROW.FILE
RETURN

Thanks again.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Thomas Derwin
Unidata on Unix has this issue, too (at least the DEC Tru64 flavor) -- it holds 
onto the file lock after CLOSESEQ of a file OPENSEQed with the Unix path.

Don't know if it's been fixed in newer UD releases, but not likely a priority 
since OPENSEQ of a VOC pointer doesn't have the problem.

 [EMAIL PROTECTED] 01/04/06 2:53 PM 
Do you recall which OS this was on?  I don't believe I've run into
this problem but I'm currently using Windows (2000 and 2003) but I've
also been on RS6000 and DG/UX.  All of this is with UV.

Unidata on Windows, as I recall.

-Kevin
[EMAIL PROTECTED]
http://www.PrecisOnline.com
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


-
This e-mail and any attachments may contain CONFIDENTIAL
information, including PROTECTED HEALTH INFORMATION. If you are not
the intended recipient, any use or disclosure of this information
is STRICTLY PROHIBITED; you are requested to delete this e-mail and
any attachments, notify the sender immediately, and notify the
LabCorp Privacy Officer at [EMAIL PROTECTED] or call (877)
23-HIPAA / (877) 234-4722.
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Kevin King
Actually I'll need to create two pointers one for the TEST account
and another for the LIVE account.

This is one of the great features of the VOC pointer; the LIVE account
can point to the directory it needs and the TEST account can point to
the directory it needs and the program doesn't have to be none the
wiser.  Of course, if the program needs to access both at the same
time that's a whole different issue...

-K
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Jeff Powell
Thanks again to everyone for all their help. I'm almost there.

I want to use the VOC pointer so I created the pointers in my Live and
Test VOC files, logged out and back in to ensure I was reading VOC but
I'm still not meeting with any success. When I attempt to reference the
pointer I get a Unintialized Variable warning during compile and 0
(zero) assumed error during execution. The path looks like
0/MTR01040600nn.ROW

LIST VOC F1 F2 F3 VERTICAL MFG.DATA.IPS.TMP 16:27:26 Jan 04 2006 1
VOC   MFG.DATA.IPS.TMP
F1DIR
F2/tmp/MFG.DATA.IPS.TEST/tmp
F3D_VOC

GOSUB GET.MTR.COUNTER
MTR.REC=MTR:OCONV(DATE(),D2/):OCONV(MTR.CTR,MR%4):.ROW
CONVERT / TO  IN MTR.REC
* -- The following line fails to compile
MTR.FILE.PATH=MFG.DATA.IPS.TMP
* -- Tim suggested the following WEOFSEQ approach to create a new file.
I'll remove the CRT statements after debugging is over.   
OPENSEQ MTR.FILE.PATH:/:MTR.REC TO F.MTR.ROW.FILE THEN
CRT 'Existing file'
END ELSE
CRT 'Creating new file'
END
WEOFSEQ F.MTR.ROW.FILE
WRITESEQ LASTREC APPEND ON F.MTR.ROW.FILE ELSE 
CALL SB.DISP(3,TROUBLE WRITING TO
:MTR.FILE.PATH:/:MTR.REC [E:STATUS():])
GO PGM.EXIT
END
CLOSESEQ F.MTR.ROW.FILE
RETURN


On Wed, 2006-01-04 at 14:38 -0700, Kevin King wrote:

 Actually I'll need to create two pointers one for the TEST account
 and another for the LIVE account.
 
 This is one of the great features of the VOC pointer; the LIVE account
 can point to the directory it needs and the TEST account can point to
 the directory it needs and the program doesn't have to be none the
 wiser.  Of course, if the program needs to access both at the same
 time that's a whole different issue...
 
 -K
 ---
 u2-users mailing list
 u2-users@listserver.u2ug.org
 To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Kevin King
Jeff, if the VOC entry is MFG.DATA.IPS.TMP then the OPEN is:

OPEN MFG.DATA.IPS.TMP, MTR.REC TO ...

Not the concatenated thing you had in your post.

-K
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread [EMAIL PROTECTED]
Jeff Powell wrote:
 Thanks again to everyone for all their help. I'm almost
there.
 
 I want to use the VOC pointer so I created the pointers in
my Live and
 Test VOC files, logged out and back in to ensure I was
reading VOC but
 I'm still not meeting with any success. When I attempt to
 reference the
 pointer I get a Unintialized Variable warning during
compile and 0
 (zero) assumed error during execution. The path looks like
 0/MTR01040600nn.ROW 
 
 LIST VOC F1 F2 F3 VERTICAL MFG.DATA.IPS.TMP 16:27:26 Jan
04 2006 1
 VOC   MFG.DATA.IPS.TMP
 F1DIR
 F2/tmp/MFG.DATA.IPS.TEST/tmp
 F3D_VOC
 
 GOSUB GET.MTR.COUNTER

MTR.REC=MTR:OCONV(DATE(),D2/):OCONV(MTR.CTR,MR%4):.ROW
 CONVERT / TO  IN MTR.REC
 * -- The following line fails to compile
 MTR.FILE.PATH=MFG.DATA.IPS.TMP

Jeff,

You have set up MFG.DATA.IPS.TMP as a VOC pointer, but if
you reference it in BASIC without quotes, the compiler
thinks it is an unassigned variable.

So, step one, wrap the name of your VOC pointer in quotes.

However, you've said you want to use VOC pointers instead of
paths, so instead of appending a / and the record name,
you want to OPENSEQ the VOC name , the record name.

So, step two, use the VOC,record syntax, not the path
syntax:

OPENSEQ MFG.DATA.IPS.TMP,MTR.REC TO MTR.REC.VBLE ELSE
* remember in UniData, OPENSEQ creates automatically
WEOFSEQ MTR.REC.VBLE
END

Other points:

1) It really isn't a great idea to go creating application
specific subdirectories in /tmp.  Fill /tmp up with junk and
the system will crash sooner or later.

2) If you need the path of an opened file variable use
FILEINFO().

Cheers,

Ken
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Timothy Snyder
Allen E. Elwood wrote on 01/04/2006 01:29:47 PM:

 I've always found it helpful to open the file/record in 'regular' mode 
first
 to find out if the directory entry worked or possibly to write a null 
record
 if it didn't.

So, if the O/S-level file is multi-megabytes, you're reading the whole 
thing into memory?  That could cause problems with shared memory and will 
certainly create a burden on the system.  It also kind of defeats the 
purpose of using a sequential file, since you're reading the whole thing 
in, then opening it again and reading through the entire file a second 
time with READSEQ.  Since you've incurred the memory and performance hit 
to pull the whole thing into a variable, you might as well waltz through 
that variable to extract the lines an attribute at a time with REMOVE or 
READNEXT.

If you're following this practice only on small files, and only 
infrequently, it's probably OK, but how can you guarantee that will always 
be the case?


Tim Snyder
Consulting I/T Specialist , U2 Professional Services
North American Lab Services
DB2 Information Management, IBM Software Group
717-545-6403
[EMAIL PROTECTED]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] openseq question

2006-01-04 Thread Logan, David (SST - Adelaide)
Further to this, you could also use the !GET.PATHNAME subroutine to get
the path and filename. A quick way to check rather than the expense of a
DB level OPEN.

Regards


---
** _/ **  David Logan 
***   _/ ***  ITO Delivery Specialist - Database
*_/*  Hewlett-Packard Australia Ltd
_/_/_/  _/_/_/    E-Mail: [EMAIL PROTECTED]
   _/  _/  _/  _/     Desk:   +618 8408 4273
  _/  _/  _/_/_/  Mobile: 0417 268 665
*_/   **
**  _/    Postal: 148 Frome Street,
   _/ **  Adelaide SA 5001
  Australia 
invent   
---

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Timothy Snyder
Sent: Thursday, 5 January 2006 1:42 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] openseq question

Allen E. Elwood wrote on 01/04/2006 01:29:47 PM:

 I've always found it helpful to open the file/record in 'regular' mode

first
 to find out if the directory entry worked or possibly to write a null 
record
 if it didn't.

So, if the O/S-level file is multi-megabytes, you're reading the whole 
thing into memory?  That could cause problems with shared memory and
will 
certainly create a burden on the system.  It also kind of defeats the 
purpose of using a sequential file, since you're reading the whole thing

in, then opening it again and reading through the entire file a second 
time with READSEQ.  Since you've incurred the memory and performance hit

to pull the whole thing into a variable, you might as well waltz through

that variable to extract the lines an attribute at a time with REMOVE or

READNEXT.

If you're following this practice only on small files, and only 
infrequently, it's probably OK, but how can you guarantee that will
always 
be the case?


Tim Snyder
Consulting I/T Specialist , U2 Professional Services
North American Lab Services
DB2 Information Management, IBM Software Group
717-545-6403
[EMAIL PROTECTED]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/