Highlighted
Absent Member.
Absent Member.
800 views

[archive] ACU4GL-FOR-MSSQL issue

[Migrated content. Thread originally posted on 03 August 2010]

I am using ACU4GL FOR MSSQL.

I have a code like this:


...

WRITE FILE1-RECORD.

...


I am trying to write a record to my table "FILE1".
The key value of FILE1 is valid but a non-key field value of FILE1 is NOT valid.

My code does NOT give me any warning on "WRITE".

When I try to find out my record in FILE1 table, I could not find it.

I would like to know how I could let my code report "writing fails" to me?
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] ACU4GL-FOR-MSSQL issue

It would be helpful if you could post a small sample program that demonstrates what is happening, and your configuration file too.

The WRITE statement performs no data validation, so you'll have to validate the data before writing.

When you say you could not find the record in the table after the write does that mean the READ failed, or were you looking at the table in the MSSQL Management Studio?

You should run with a level 9 file trace. To do that add "-dlxe runtime.log" to your Runtime command line before the program name. When the debugger starts enter "tf 9", then "t flush", then "g". After your program run is complete zip up the log and attach it.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] ACU4GL-FOR-MSSQL issue

"It would be helpful if you could post a small sample program that demonstrates what is happening, and your configuration file too. "

The following is my original code:

       MOVE-CSIFJC14-TO-JCAUDIT.
           MOVE SPACES                  TO WS-FILE-DESCRIPTION.
           MOVE "csifjc14(JCAUDIT)"     TO WS-FILE-DESCRIPTION.
           PERFORM WRITE-FILE-START-LOG
           THRU    WRITE-FILE-START-LOG-EXIT.
           ADD 1                        TO FILE-COUNT.
       READ-NEXT-V-JCAUDIT.
           READ V-JCAUDIT NEXT
           AT END
             PERFORM WRITE-FILE-FINAL-LOG
             THRU    WRITE-FILE-FINAL-LOG-EXIT
             EXIT PARAGRAPH
           END-READ.
           MOVE V-JCAUDIT-RECORD        TO JCAUDIT-RECORD.
           WRITE JCAUDIT-RECORD.
           PERFORM DISPLAY-RECORD-SCREEN
           THRU    DISPLAY-RECORD-SCREEN-EXIT.
           GO TO READ-NEXT-V-JCAUDIT.
       MOVE-CSIFJC14-TO-JCAUDIT-EXIT.
           EXIT.


"The WRITE statement performs no data validation, so you'll have to validate the data before writing."
Follow your advice, and I add a read after write(actually I should add it before WRITE,but it is okay for me)


       MOVE-CSIFJC14-TO-JCAUDIT.
           MOVE SPACES                  TO WS-FILE-DESCRIPTION.
           MOVE "csifjc14(JCAUDIT)"     TO WS-FILE-DESCRIPTION.
           PERFORM WRITE-FILE-START-LOG
           THRU    WRITE-FILE-START-LOG-EXIT.
           ADD 1                        TO FILE-COUNT.
       READ-NEXT-V-JCAUDIT.
           READ V-JCAUDIT NEXT
           AT END
             PERFORM WRITE-FILE-FINAL-LOG
             THRU    WRITE-FILE-FINAL-LOG-EXIT
             EXIT PARAGRAPH
           END-READ.
           MOVE V-JCAUDIT-RECORD        TO JCAUDIT-RECORD.
           WRITE JCAUDIT-RECORD.
           READ JCAUDIT KEY IS JCAUDIT-KEY
           INVALID
             ADD 1                      TO RECORD-BAD-COUNT
             MOVE SPACES                TO WS-FILE-KEY
             MOVE JCAUDIT-KEY           TO WS-FILE-KEY
             PERFORM WRITE-FILE-FAIL-LOG
             THRU    WRITE-FILE-FAIL-LOG-EXIT
           NOT INVALID
             ADD 1                      TO RECORD-WRITE-COUNT     
           END-READ.
           PERFORM DISPLAY-RECORD-SCREEN
           THRU    DISPLAY-RECORD-SCREEN-EXIT.
           GO TO READ-NEXT-V-JCAUDIT.
       MOVE-CSIFJC14-TO-JCAUDIT-EXIT.
           EXIT.


"When you say you could not find the record in the table after the write does that mean the READ failed, or were you looking at the table in the MSSQL Management Studio?"

I were looking at the table in the MSSQL Management Studio.


"You should run with a level 9 file trace. To do that add "-dlxe runtime.log" to your Runtime command line before the program name. When the debugger starts enter "tf 9", then "t flush", then "g". After your program run is complete zip up the log and attach it. "

Good advice, and I see a lot more help information from the log file now.


Thanks a lot.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.