ksam rewrite problem

ksam rewrite problem

Post by Michael Ca » Thu, 18 May 2006 05:24:27


I have A ksam file with one key (duplicates allowed).
Ex:
Key data-field
A 001
B 002
C 003
C 004
D 005
E 006

I start at key C, read a record and update the data field to X
I read another rec (the next C) and update the data field to Y
I then stop because I only wanted to update the 'C' recs.

At the end, the 2 C recs are as follows:
C YYY
C YYY
The data portions of both are the same.
I've tried NM and CM KSAM.
The code is NM COBOL.
I've tried COBOL start/read/rewrite as well as
the intrinsics (CKSTART/CKREAD/CKREWRITE).
The manuals do indicate some odd things happening with record
pointers but only when changing keys and I'm not doing that.
Has anyone run across this ?

Mike

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *
 
 
 

ksam rewrite problem

Post by Tony Summe » Thu, 18 May 2006 17:50:50

lthough we use KSAM extensively, all our KSAM files have the first
(primary) key as non-duplicates. Could you change your key structure
so that all records were made unique by extending of the key -

e.g. C+-0001 for first C record, C+-0002 etc.

-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of Michael Caplin
Sent: 16 May 2006 21:24
To: XXXX@XXXXX.COM
Subject: [HP3000-L] ksam rewrite problem

I have A ksam file with one key (duplicates allowed).
Ex:
Key data-field
A 001
B 002
C 003
C 004
D 005
E 006

I start at key C, read a record and update the data field to X
I read another rec (the next C) and update the data field to Y
I then stop because I only wanted to update the 'C' recs.

At the end, the 2 C recs are as follows:
C YYY
C YYY
The data portions of both are the same.
I've tried NM and CM KSAM.
The code is NM COBOL.
I've tried COBOL start/read/rewrite as well as
the intrinsics (CKSTART/CKREAD/CKREWRITE).
The manuals do indicate some odd things happening with record
pointers but only when changing keys and I'm not doing that.
Has anyone run across this ?

Mike

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

The contents of this email are confidential to the intended recipient
and may not be disclosed. Although it is believed that this email and
any attachments are virus free, it is the responsibility of the recipient to confirm this.

Smith & Williamson Corporate Finance Limited - A member of the London Stock Exchange.
A member of M&A International Inc. http://www.mergers.net Registered in England No. 4533970. Authorised and regulated by the Financial Services Authority
Smith & Williamson Investment Management Limited, Registered No. 976145. Authorised and regulated by the Financial Services Authority.
Smith & Williamson Pension Consultancy Limited - Independent Intermediary. Registered No. 3133226. Authorised and regulated by the Financial Services Authority.
Smith & Williamson Fund Administration Limited, Registered No. 1934644. Authorised and regulated by the Financial Services Authority.
Smith & Williamson Limited - A member of Nexia International. Registered in England No. 4534022. Regulated by the Institute of Chartered Accountants in England & Wales for a range of investment business activities.
NCL Investments Limited, Registered No. 1913794.
Member of the London Stock Exchange authorised and regulated by the Financial Services Authority.

Registered Office: 25 Moorgate, London EC2R 6AY
Telephone: 020 7131 4000 http://www.smith.williamson.co.uk

Nexia Smith & Williamson Audit Limited - A member of Nexia International. Registered in England No. 4469576.
Nexia Smith & Williamson Audit Limited is a company registered to carry out audit work and is regulated for a range of investment activities by the Institute of Chartered Accountants in England and Wales. Smith & Williamson Limited is a separate company that provides professional resources and certain services to Nexia Smith & William
 
 
 

ksam rewrite problem

Post by MICHAEL CA » Thu, 18 May 2006 23:23:28

hanks to all who responded.
I got this from Cathlene Mc Rae at HP
So it appears if the primary key has duplicates, the rewrite writes to
the chain head not the current record. The recommend way to do the
update is with fupdate.
I changed REWRITE to FUPDATE and that took care of the problem.
Mike


-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of Michael Caplin
Sent: 16 May 2006 21:24
To: XXXX@XXXXX.COM
Subject: [HP3000-L] ksam rewrite problem

I have A ksam file with one key (duplicates allowed).
Ex:
Key data-field
A 001
B 002
C 003
C 004
D 005
E 006

I start at key C, read a record and update the data field to X
I read another rec (the next C) and update the data field to Y
I then stop because I only wanted to update the 'C' recs.

At the end, the 2 C recs are as follows:
C YYY
C YYY
The data portions of both are the same.
I've tried NM and CM KSAM.
The code is NM COBOL.
I've tried COBOL start/read/rewrite as well as
the intrinsics (CKSTART/CKREAD/CKREWRITE).
The manuals do indicate some odd things happening with record
pointers but only when changing keys and I'm not doing that.
Has anyone run across this ?

Mike

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

The contents of this email are confidential to the intended recipient
and may not be disclosed. Although it is believed that this email and
any attachments are virus free, it is the responsibility of the
recipient to confirm this.

Smith & Williamson Corporate Finance Limited - A member of the London
Stock Exchange.
A member of M&A International Inc. http://www.mergers.net Registered in
England No. 4533970. Authorised and regulated by the Financial Services
Authority
Smith & Williamson Investment Management Limited, Registered No.
976145. Authorised and regulated by the Financial Services Authority.
Smith & Williamson Pension Consultancy Limited - Independent
Intermediary. Registered No. 3133226. Authorised and regulated by the
Financial Services Authority.
Smith & Williamson Fund Administration Limited, Registered No. 1934644.
Authorised and regulated by the Financial Services Authority.
Smith & Williamson Limited - A member of Nexia International.
Registered in England No. 4534022. Regulated by the Institute of
Chartered Accountants in England & Wales for a range of investment
business activities.
NCL Investments Limited, Registered No. 1913794.
Member of the London Stock Exchange authorised and regulated by the
Financial Services Authority.

Registered Office: 25 Moorgate, London EC2R 6AY
Telephone: 020 7131 4000 http://www.smith.williamson.co.uk

Nexia Smith & Williamson Audit Limited - A member of Nexia
International. Registered in England No. 4469576.
Nexia Smith & Williamson Audit Limited is a company registered to carry
out audit work and is regulated for a range of investment activities by
the Institute of Chartered Accountants in England and Wales. Smith &
Williamson Limited is a separate company that provides professional
resources and certain services to Nexia
 
 
 

ksam rewrite problem

Post by Walter J. » Wed, 24 May 2006 13:40:17

'll second Tony's suggestion.

The ability to have a KSAM (Indexed) file with duplicates on the primary
key is an HP extension to standard COBOL.

When you rely on such extensions, you enter an area that is less well
defined, less well documented, and less well tested, not to mention less
portable, than when you stick with standard COBOL.

That having been said, I recognize that changing your design at this
point might not be feasible.

Walter

Walter J. Murray

-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of Tony Summers
Sent: Wednesday, May 17, 2006 1:51 AM
To: XXXX@XXXXX.COM
Subject: Re: [HP3000-L] ksam rewrite problem

Although we use KSAM extensively, all our KSAM files have the first
(primary) key as non-duplicates. Could you change your key structure
so that all records were made unique by extending of the key -

e.g. C+0001 for first C record, C+0002 etc.

-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of Michael Caplin
Sent: 16 May 2006 21:24
To: XXXX@XXXXX.COM
Subject: [HP3000-L] ksam rewrite problem

I have A ksam file with one key (duplicates allowed).
Ex:
Key data-field
A 001
B 002
C 003
C 004
D 005
E 006

I start at key C, read a record and update the data field to X
I read another rec (the next C) and update the data field to Y
I then stop because I only wanted to update the 'C' recs.

At the end, the 2 C recs are as follows:
C YYY
C YYY
The data portions of both are the same.
I've tried NM and CM KSAM.
The code is NM COBOL.
I've tried COBOL start/read/rewrite as well as
the intrinsics (CKSTART/CKREAD/CKREWRITE).
The manuals do indicate some odd things happening with record
pointers but only when changing keys and I'm not doing that.
Has anyone run across this ?

Mike

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

The contents of this email are confidential to the intended recipient
and may not be disclosed. Although it is believed that this email and
any attachments are virus free, it is the responsibility of the
recipient to confirm this.

Smith & Williamson Corporate Finance Limited - A member of the London
Stock Exchange.
A member of M&A International Inc. http://www.mergers.net Registered in
England No. 4533970. Authorised and regulated by the Financial Services
Authority
Smith & Williamson Investment Management Limited, Registered No. 976145.
Authorised and regulated by the Financial Services Authority.
Smith & Williamson Pension Consultancy Limited - Independent
Intermediary. Registered No. 3133226. Authorised and regulated by the
Financial Services Authority.
Smith & Williamson Fund Administration Limited, Registered No. 1934644.
Authorised and regulated by the Financial Services Authority.
Smith & Williamson Limited - A member of Nexia International.
Registered in England No. 4534022. Regulated by the Institute of
Chartered Accountants in England & Wales for a range of investment
business
 
 
 

ksam rewrite problem

Post by Walter J. » Wed, 24 May 2006 13:45:44

ood luck! You are going where angels fear to tread.

I strongly recommend against mixing the use of COBOL verbs and file
system intrinsics on the same file.

You are doing things behind COBOL's back, and, while it might seem to
work O.K. now, it may very well come back to bite you.

Walter

Walter J. Murray

-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of MICHAEL CAPLIN
Sent: Wednesday, May 17, 2006 7:23 AM
To: XXXX@XXXXX.COM
Subject: Re: [HP3000-L] ksam rewrite problem

Thanks to all who responded.
I got this from Cathlene Mc Rae at HP
So it appears if the primary key has duplicates, the rewrite writes to
the chain head not the current record. The recommend way to do the
update is with fupdate.
I changed REWRITE to FUPDATE and that took care of the problem.
Mike


-----Original Message-----
From: HP-3000 Systems Discussion [mailto: XXXX@XXXXX.COM ] On
Behalf Of Michael Caplin
Sent: 16 May 2006 21:24
To: XXXX@XXXXX.COM
Subject: [HP3000-L] ksam rewrite problem

I have A ksam file with one key (duplicates allowed).
Ex:
Key data-field
A 001
B 002
C 003
C 004
D 005
E 006

I start at key C, read a record and update the data field to X
I read another rec (the next C) and update the data field to Y
I then stop because I only wanted to update the 'C' recs.

At the end, the 2 C recs are as follows:
C YYY
C YYY
The data portions of both are the same.
I've tried NM and CM KSAM.
The code is NM COBOL.
I've tried COBOL start/read/rewrite as well as
the intrinsics (CKSTART/CKREAD/CKREWRITE).
The manuals do indicate some odd things happening with record
pointers but only when changing keys and I'm not doing that.
Has anyone run across this ?

Mike

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

The contents of this email are confidential to the intended recipient
and may not be disclosed. Although it is believed that this email and
any attachments are virus free, it is the responsibility of the
recipient to confirm this.

Smith & Williamson Corporate Finance Limited - A member of the London
Stock Exchange.
A member of M&A International Inc. http://www.mergers.net Registered in
England No. 4533970. Authorised and regulated by the Financial Services
Authority
Smith & Williamson Investment Management Limited, Registered No.
976145. Authorised and regulated by the Financial Services Authority.
Smith & Williamson Pension Consultancy Limited - Independent
Intermediary. Registered No. 3133226. Authorised and regulated by the
Financial Services Authority.
Smith & Williamson Fund Administration Limited, Registered No. 1934644.
Authorised and regulated by the Financial Services Authority.
Smith & Williamson Limited - A member of Nexia International.
Registered in England No. 4534022. Regulated by the Institute of
Chartered Accountants in England & Wales for a range of investment
business activities.
NCL Investments Limited, Registered No. 1913794.
Member of the London Stock Exchange authorised and regulated by the
Financial Services Authority
 
 
 

ksam rewrite problem

Post by Brian Dona » Fri, 26 May 2006 07:51:42

I agree with Walter --

Yes, I *know* from personal experience the Cobol OPEN, FOPEN and HPFOPEN
intrinsics can and do return the same file number on DIFFERENT files.

Definitely not a good idea.

BTDT (with disastrous results),

Brian Donaldson.

<<snip>>

Good luck! You are going where angels fear to tread.

I strongly recommend against mixing the use of COBOL verbs and file
system intrinsics on the same file.

You are doing things behind COBOL's back, and, while it might seem to
work O.K. now, it may very well come back to bite you.

Walter

Walter J. Murray
<<end of snip>>



* To join/leave the list, search archives, change list settings, *
* etc., please visit http://www.yqcomputer.com/ *