× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Joan,

When you do the
  *Lock         In        ZNXTRN                               91
statement, test if *IN91 is on because if another program has a lock on
ZNXTRN already, OS/400 tries for 30 seconds to get a lock and then just
falls on through to the next statement.  Our code is:
TRNTAG            TAG
*LOCK                in(E)             ZNXTRN
                          IF                %ERROR = *ON
                          GOTO          TRNTAG
(this is the ONLY time I ever use a GOTO)  Just loops until it gets a lock.
We were getting duplicate transaction numbers for years and finally figured
out that if ZNXTRN was already locked, the code was falling through and
giving the next number (same number) to multiple transactions.  One actually
had a lock, the other(s) not.  Our save-while-active had it locked while
data collection scans/green-screen entries were continuing to process -
sending transactions and getting the duplicates.

Happy coding,
Ann

-----Original Message-----
From: mapics-l-bounces@xxxxxxxxxxxx
[mailto:mapics-l-bounces@xxxxxxxxxxxx]On Behalf Of McCready, Joan
Sent: Wednesday, July 09, 2003 10:33 AM
To: 'MAPICS ERP System Discussion'
Subject: RE: AMI3G


Thanks, Peter!  -- Joan

-----Original Message-----
From: Peter Vidal [mailto:Peter_Vidal@xxxxxxxx]
Sent: Wednesday, July 09, 2003 10:22 AM
To: MAPICS ERP System Discussion
Subject: RE: AMI3G



"A followup question - and I need the answer yesterday! (nach) Steve, what
do you do about creating the transaction numbers? If you leave the field
blank, does TRDATA processing generate the "next" number needed, or do you
have a number series that you use to populate the transaction number as you
populate the TRDATA records?"

Yes; on your program, you need to read a data area called ZNXTRN and maybe
do something like (somebody from the list helped me once):
C     Pull_Trans#   Begsr
C                   Clear                   znxtrn
C                   Clear                   *In91
C     *Dtaara       Define                  ZNXTRN
C                   Dou       *In91 = *Off
<-----|
C     *Lock         In        ZNXTRN                               91
|
C                   Enddo
<-----|
C                   Dou       *In91 = *Off
<-----|
C                   Eval      ZNXTRN = ZNXTRN + 1
|
|
C                   If        ZNXTRN = 0
|
C                   Eval      ZNXTRN = 1
|
C                   Endif
|
|
C     ZNXTRN        setll     TRDataz0                               91
|
C                   Enddo
<-----|
C                   Out       ZNXTRN
C                   Endsr

You will get the idea.  HTH!
Peter Vidal
Pall Aeropower Corp.
SR Programmer Analyst
WWW.Pall.com / 727-539-8448, x2414

"A good player makes himself look good; a great player makes the team look
good." Author unknown


_______________________________________________
This is the MAPICS ERP System Discussion (MAPICS-L) mailing list To post a
message email: MAPICS-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/mapics-l
or email: MAPICS-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mapics-l.
_______________________________________________
This is the MAPICS ERP System Discussion (MAPICS-L) mailing list
To post a message email: MAPICS-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mapics-l
or email: MAPICS-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mapics-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.