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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add data to P8 data item thru query.pub.sys? 2

Status
Not open for further replies.

aHash

Programmer
Aug 22, 2000
78
0
0
US
I am trying to add a record to a cross reference table.
I have all the three keys available in the master dataset.
But I am not able to add via Query's UPDATE ADD .

SET NAME:
ACT-WO-DET,DETAIL

ITEMS:
EM-UNIT-NO, X10 <<SEARCH ITEM>>
WM-WO-NO, P8 <<SEARCH ITEM>>
LM-LOC-NO, X4 <<SEARCH ITEM>>

These are from the mast data set, when I do a,

F WO-MAST.EM-UNIT-NO=2121 AND WM-START-DATE="19990722"

WM-WO-NO =900045{
EM-UNIT-NO =2121
LM-LOC-NO =0001

My question is How can i add a record in the detail set,
when wm-wo-no = '900045{' ??

If i enter 900045{ it give an error of

"MISSING SEARCH KEY VALUE FOR WM-WO-NO IN MASTER WO-MAST "

Please Help. Thanks a lot in advance.
Ahash


 
Update:

I wrote a small program to acheive the same thing using DBPUT,
But could not get past this error? what am I doing wrong?

Here the code and error? :-(

001000$CONTROL LIST, USLINIT
001100 IDENTIFICATION DIVISION.
001200 PROGRAM-ID. INAWO.
001300
001400******************************************************************
001500* *
001600* Copyright 1995 TRINODAL SYSTEMS CORPORATION *
001700* *
001800* This program contains proprietary information which is *
001900* protected by copyright. All rights are reserved. NO *
002000* part of this program may be copied (except for archival *
002100* purposes), repoduced, or translated to another program *
002200* language without the prior written consent of: *
002300* *
002400* TRINODAL SYSTEMS CORPORATION *
002500* 3010 S Broad St, Trenton, New Jersey 08610 *
002600* *
002700******************************************************************
002800
002900******************************************************************
003000* *
003100* CHANGE UNIT # TO ENTERED UNIT # IN WO-MAST, WO-DET, *
003200* LABOR-DET, PARTS-DET & COMM-DET DATA SETS. *
003300* *
003400******************************************************************
003500
003600 ENVIRONMENT DIVISION.
003700 CONFIGURATION SECTION.
003800 SOURCE-COMPUTER. HP3000.
003900 OBJECT-COMPUTER. HP3000.
004000 SPECIAL-NAMES.
004100 CONDITION-CODE IS INTRINSIC-RESULT.
004200
004300 DATA DIVISION.
004400$PAGE "WORKING STORAGE"
004500 WORKING-STORAGE SECTION.
004600 01 WS-RELEASE.
004700 03 FILLER PIC X(8) VALUE "Release ".
004800 03 WS-REL-NO PIC X(8) VALUE "01.01.05".
004900
005000 01 COMMAND-AREA.
005100 03 INTR-ERR1 PIC S9(4) COMP VALUE 0.
005200 03 INTR-ERR2 PIC S9(4) COMP VALUE 0.
005300
005400 COPY DCDBCOMM IN DCSLIB.
005500
005600 COPY WOMAST IN DCSLIB.
005700
005800 COPY AWODET IN DCSLIB.
005900
006700
006800 01 WS.
006900 03 WS-EM-UNIT-NO PIC X(10).
006900 03 WS-LM-LOC-NO PIC X(4).
007100 03 WS-WO-NO PIC 9(7).
007200 03 WS-VALID PIC X.
007300
007400 03 WS-STARS PIC X(50) VALUE
007500 "**************************************************".
007600
007700 COPY ERRMESS IN TSCLIB.
007800$PAGE "010 THRU 099 -- OPEN AND INITIALIZE"
007900 PROCEDURE DIVISION.
008000 010-START-PROG.
008100 MOVE "INAWO" TO EM-PROGRAM.
008200 MOVE WS-RELEASE TO EM-MESSAGE.
008300 DISPLAY ERROR-MESSAGE.
008400 PERFORM 700-OPEN-DATA-BASE THRU 700-ODB-EXIT.
008500$PAGE "100 THRU 199 -- MAIN PROGRAM"
008600 100-ASK-WO-NO.
008700 MOVE 0 TO WS-WO-NO.
008800 MOVE SPACES TO WS-EM-UNIT-NO.
008800 MOVE SPACES TO WS-LM-LOC-NO.
008900 DISPLAY "ENTER UNIT # ".
009000 ACCEPT WS-EM-UNIT-NO.
008900 DISPLAY "ENTER WO # ".
009000 ACCEPT WS-WO-NO.
008900 DISPLAY "ENTER LOC # ".
009000 ACCEPT WS-LM-LOC-NO.
009100 MOVE WS-EM-UNIT-NO TO AW-EM-UNIT-NO.
MOVE WS-WM-WO-NO TO AW-WM-WO-NO.
MOVE WS-LM-LOC-NO TO AW-LM-LOC-NO.
038500
012600 PERFORM 750-WRITE-WO-DET THRU 750-WWD-EXIT.
012700 DISPLAY "FINISHED".
012800 DISPLAY " ".
012900 GO TO 100-ASK-WO-NO.
020600$PAGE "700 THRU 799 -- DATA BASE ROUTINES"
020700 700-OPEN-DATA-BASE.
020800 CALL "DBOPEN" USING DC-NAME, DC-PASS, DC-MODE1, DC-STATUS.
020900
021000 IF DC-RESULT NOT = 0
021100 MOVE "DBOPEN (DCSDB) FAILED" TO EM-MESSAGE
021200 MOVE DC-RESULT TO EM-STATUS
021300 GO TO 999-END-RUN.
021400 700-ODB-EXIT.
021500 EXIT.
021600
038600 750-WRITE-WO-DET.
038700 CALL "DBLOCK" USING DC-NAME, DC-QUALIFIER, DC-MODE1,
038800 DC-STATUS.
038900
039000 IF DC-RESULT NOT = 0
039100 MOVE "DBLOCK -- AWO-DET WRITE " TO EM-MESSAGE
039200 MOVE DC-RESULT TO EM-STATUS
039300 GO TO 999-END-RUN.
039400
039500 CALL "DBPUT" USING DC-NAME, DC-ACT-WO-DET, DC-MODE1,
039600 DC-STATUS, DC-AW-LIST, DC-AW-BUFFER.
039700
039800 IF DC-RESULT NOT = 0
039900 MOVE "DBPUT -- AWO-DET " TO EM-MESSAGE
040000 MOVE DC-RESULT TO EM-STATUS
040100 GO TO 999-END-RUN.
040200
040300 CALL "DBUNLOCK" USING DC-NAME, DC-ACT-WO-DET, DC-MODE1,
040400 DC-STATUS.
040500
040600 IF DC-RESULT NOT = 0
040700 MOVE "DBUNLOCK -- AWO-DET WRITE" TO EM-MESSAGE
040800 MOVE DC-RESULT TO EM-STATUS
040900 GO TO 999-END-RUN.
041000 750-WWD-EXIT.
041100 EXIT.
041200
054700$PAGE "990 THRU 999 -- CLEANUP AND CLOSEUP ROUTINES"
054800 999-END-RUN.
054900 CALL "DBCLOSE" USING DC-NAME, DC-ACT-WO-DET, DC-MODE1,
055000 DC-STATUS.
055100
055200 IF EM-STATUS = 0
055300 NEXT SENTENCE
055400 ELSE
055500 DISPLAY WS-STARS
055600 DISPLAY WS-STARS
055700 DISPLAY "*"
055800 DISPLAY "* ", ERROR-MESSAGE
055900 DISPLAY "* "
056000 DISPLAY WS-STARS
056100 DISPLAY WS-STARS
056200 CALL INTRINSIC "QUIT" USING 872.
056300
056400 STOP RUN.


ERROR:

**************************************************
**************************************************
*
* INAWO DBPUT -- AWO-DET 0102+0000+0000+

*
**************************************************
**************************************************
**** PROGRAM ERROR #18 :pROCESS QUIT .PARAM = 872
ABORT: AWOR.DCS.DEV
NM SYS a.00a83288 dbg_abort_trace+$24
CM SYS % 230.404 SWITCH'TO'NM'+%4 SUSER1
CM PROG % 0.1072

Please help. Thanks
 
Ahash -


You're missing the chain head for path #2. This is likely a manual master that requires an entry BEFORE you can add the detail data set record. See the DBPUT error code 102 information in the above IMAGE manual.

Regards.

Glenn

BTW, you will find much better information and a more active group if you post to the HP3000-L Listserve (check google groups for that or so a google search).
 
Hi Glenn,

Thanks for the reply. Can I not insert a detail row for an existing master entry? I have a master record already, why would not I be able to insert a detail rec?

Checked out the listserv group. I will start using rightawy.
Thank for the info. It looks great.
 
Update :

I was able to do it using CBASAG. I created simple auto generated screen, Defined my dataset as CBAS CONTROLLED DATASET and supplied password thru PW command. and used GO command from CBASAG.

I was able to insert a detail record when there is already an already existing master record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top