Jump to content


Photo
- - - - -

Paging file update


  • This topic is locked This topic is locked
2 replies to this topic

#1 Gary Wilhelm

Gary Wilhelm

    Advanced

  • Members
  • PipPipPip
  • 70 posts
  • Gender:Male
  • Location:Somerset, United States

Posted 03 November 2006 - 07:42 PM

Here is my dilema. First of all, lemme list my system again.

PROIV 5.5 running in regular mode (Not Superlayer)
ISAM files
Red Hat Enterprise OS
Developer Studio

Anyway, I am trying to parse through a text file being read on the server. The file has as many as 1000 characters. In PROIV (Update function) I used a FOR loop to get 75 characters at a time then I pass the key (ssn) and the data to the global update call which should be adding the text one record at a time to the file. The first call works fine. I use GETLPSEQ to get the last sequence number, then I add the first record. The next time it passes through, it does show the next number to use, but fails to write the next record. No matter what I have tried, I can't get past this hurdle. If anyone has a suggestion on another way to add records from parsing a text file, I would appreciate it as well.

Thanks in advance

-Gary

#2 Donald Miller

Donald Miller

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 205 posts
  • Gender:Male
  • Location:Cupar, Fife, Scotland
  • Interests:Motorcycling, Running, Cooking

Posted 04 November 2006 - 09:01 AM

Hi Gary

Is the Global Update property .OneTime set to TRUE ?

Using a local cycle for writing a single paging record within a screen function and using VIP and an Update cycle for the write - I couldn't get to work. Using a many time paging screen cycle does if the .OneTime property is set for the paging cycle.

Hope that's useful

Donald
Half of what he said meant something else, and the other half didn't mean anytthing at all

#3 Mike Schoen

Mike Schoen

    Expert

  • Members
  • PipPipPipPip
  • 198 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 05 November 2006 - 02:57 PM

Gary,

Is it possible for you to obtain a lock on the file (by ssn for example), and handle the sequencing yourself?

For example, in the import function lock a record, call getlpseq once, and then use a scratch variable to control the sequences yourself?

Also, are you writing to the file in add mode as the first file on cycle one of the update, or do you read something in lookup mode first? We usually read a record in L-mode first, and have file 2 as the add mode with getlpseq?

I just threw a function together as an example. The file "DUMMY" is a file with 1 record with a blank key,
that we use in cases where pro-iv complains that you can't have file 1 in add mode.
FUNCTION DEFINITION
REV#: 5.5000
FUNCTION NAME: MSDELME2 TITLE: THIS IS A TEST
TYPE: GU SPECS CHG ON: RESET ON: 11/05/06


-------------------------- LOGICAL UPDATE INFORMATION --------------------------
UPDATE# : 01 DEF LOGIC : EXIT LOGIC : ONE TIME :
PARTIAL : START UPD# : 1 END UPD# : 1

------------------------------ FILE INFORMATION -------------------------------
LOGIC-ID:BEFORE AFTER-READ BEFORE AFT-WRTE
FILE--NAME-- MODE CLEAR BREAK# READ ERR NO-ERR WRITE ERR PCB#
01 DUMMY L
02 ARCN A 1 2

LGID LNE STEP ------------------------ S T A T E M E N T -------------------------
001 001 ARCN_CUST_N = ' MHS'
002 #S = GETLPSEQ('ARCN') + 1 ARCN_SEQ_N = PIC(#S,'999')


002 001 ARCN_NOTE = $DATA
GLOBAL FUNCTION INTERFACE PARAMETERS

SEQ PARM TYPE PARAMETER VARIABLE NAME VAR TYPE LEN ARRAY SIZE
--- --------- -------------------------------- -------- --- ----------
001 I $DATA A 20


Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users