- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: vax manipulation of .DAT file
Operating System - OpenVMS
1755644
Members
3504
Online
108837
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2006 02:03 AM
тАО09-12-2006 02:03 AM
Re: vax manipulation of .DAT file
A lot of words were written already (by me :-), but it may still be simple.
Did you try a straight 'convert' on the file that was 'fixed' on Unix, using the fdl?
That may be all that is needed.
Below you'll find one final contribution, with a vms-only dcl script doing the work pretty much as outlined. It is UNTESTED, so read and study carefully. Use VMS HELP as needed.
Along its path it reports (or intents to, remember untested :-) the first 3 records modified and actually dumps the last one of those to allow you to verify the changes before putting the new file into operation.
Enjoy,
Hein.
$old = "circuit.bak"
$new = "circuit.new"
$fdl = "circuit.fdl"
$tmp = "tmp.tmp"
$mod = 0
$num = 0
$
$close/nolog old
$close/nolog tmp
$creat/fdl=sys$input 'tmp
file; allo 20000; exte 5000; record; size 773; form fixed
$open/appe tmp 'tmp
$open/read old 'old
$
$loop:
$read/end=done old record
$num = num + 1
$if "XG".eqs.F$EXTR(205,2,record)
$then
$ mod = mod + 1
$
$ old_key = F$EXTR(00,38,record)
$ new_key = F$EXTR(86,38,record)
$ mid = F$EXTR(38,48,record)
$ rest = F$EXTR(124,999,record)
$ record = new_key + mid + old_key + rest
$
$ if mod.lt.3
$then
$ write sys$output "Record ''num', Old=''old_key', New=''New_key'"
$ sample = num
$endif
$
$endif
$write/symbol tmp record
$goto loop
$
$done:
$write sys$output "''num' records read, ''mod' modified."
$close old
$close tmp
$dump /record=(count=1,stat='sample') 'tmp
$conv/stat/fast/sort/fdl='fdl' 'tmp 'new
$exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2006 02:21 PM
тАО09-13-2006 02:21 PM
Re: vax manipulation of .DAT file
Thank you very much, I have used your script, and get some of the expected results, but with questions.
First it looks like it errors on a variable. That I can not figure out from where.
Unrecognised key word...
Duplicate Key encounter...
It made the swap (all except two) what does this mean?
beta::[SSTRSSYS.DATA] @MOD_CIRCUIT.COM;2
Record 81763, Old=399199 , New=WNPGMB05ONU6
Record 81764, Old=399256 , New=WNPGMB01ONU5
113167 records read, 1426 modified.
%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
\STAT\
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
CONVERT Statistics
Number of Files Processed: 1
Total Records Processed: 113167 Buffered I/O Count: 215
Total Exception Records: 5 Direct I/O Count: 63498
Total Valid Records: 113162 Page Faults: 12080
Elapsed Time: 0 00:27:06.95 CPU Time: 0 00:08:45.32
I will need to do additional testing with this but I believe I am on to something.
First it looks like it errors on a variable. That I can not figure out from where.
Unrecognised key word...
Duplicate Key encounter...
It made the swap (all except two) what does this mean?
beta::[SSTRSSYS.DATA] @MOD_CIRCUIT.COM;2
Record 81763, Old=399199 , New=WNPGMB05ONU6
Record 81764, Old=399256 , New=WNPGMB01ONU5
113167 records read, 1426 modified.
%DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
\STAT\
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
%CONVERT-I-DUP, duplicate key encountered
CONVERT Statistics
Number of Files Processed: 1
Total Records Processed: 113167 Buffered I/O Count: 215
Total Exception Records: 5 Direct I/O Count: 63498
Total Valid Records: 113162 Page Faults: 12080
Elapsed Time: 0 00:27:06.95 CPU Time: 0 00:08:45.32
I will need to do additional testing with this but I believe I am on to something.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2006 02:38 PM
тАО09-13-2006 02:38 PM
Re: vax manipulation of .DAT file
>> Record 81763, Old=399199 ,New=WNPGMB05ONU6
>> Record 81764, Old=399256 , New=WNPGMB01ONU5
Those are just two key samples from the first records encountered which needed change.
>> 113167 records read, 1426 modified.
Just a status message.
The numbers suggests that an inline delete+rewrite would have been reasonable.
>> %DCL-W-IVKEYW, unrecognized keyword - check validity and spelling
\STAT\
Ooops, that should have been "START"
The DUMP is just an other sanity check that the script is doign the right thing best we can tell.
You can do the same dump on both files and compare byte by byte if need be.
>> %CONVERT-I-DUP, duplicate key encountered
>> %CONVERT-I-DUP, duplicate key encountered
Now you get into application space.
The file is designed NOT to allow duplicates.
The swap apparently created duplicates.
CONVERT can not decide which is good, which is bad.
Please add /EXCEP=circuit.exception to the final convert command line an try again.
Convert will put those problem records in the exception file and yhe application folks will have to decide what to do next.
They may (should!) have the tools to play with records. Datatrieve perhaps.
If they are at loss, the carefully study the other scripts I provided. They show how to read and delete or write records from an indexed file using DCL. You can use that to play with individual records, by primary or by alternate key (add /IND=1)
Try for example
$OPEN/read/share=write x circuit.old
$READ/KEY=WNPGMB05ONU6/IND=1 x y
$SHOW SYMBOL y
Total Exception Records: 5
Direct I/O Count: 63498
Total Valid Records: 113162
That seems reasonable.
>> I will need to do additional testing with this but I believe I am on to something.
Close, very close...
And a lot learned!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2006 03:58 AM
тАО09-22-2006 03:58 AM
Re: vax manipulation of .DAT file
I want to thank Hein for all his work, I can say that I would not be anywhere close if it was not for him.
I have been testing all week, and I am confident that I can go ahead with these changes.
Appreciate the help.
Thanks
Laura
I have been testing all week, and I am confident that I can go ahead with these changes.
Appreciate the help.
Thanks
Laura
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP