View previous topic :: View next topic
|
Author |
Message |
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
I want to do either a mass key change or key insert into a VSAM file. Hopefully the same file, verses creating a new and deleting then renaming the updated/extracted file.
I have a limitation where I need to do two compares in one of the key fields. It is possible that part of the key field I am looking to change should be numeric only, alpha and/or spaces might exist in the key field. I do not want to change them.
I have INSYNC Ver 6.100? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As with most questions like this, it is best to post some sample input and the output you want from that sample input.
Explain the rules for getting from the input (why some records were kept, discarded, changed, etc).
From the little provided,
Make a backup of the vsam file.
Process the vsam file as input and write a qsam file as output with the data modifications.
Then delete/define the existing vsam file.
Reload the data.
The process(*) and reload can be done with your sort product.
Which sort product is used on the system?
(*) - maybe, depending on the actual rules. |
|
Back to top |
|
|
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
I've been digging for some documentation for INSYNC. That would be the most helpful.
The basic example is the existing key information contains dates for the beginning of the key.
Code: |
C LVL FIELD NAME FORMAT BOOL CN DATA
********************************** TOP OF DATA **********
01 FIELDFD G
05 FIELDKEY G
10 FIELDDATE C 6
10 FILLER G
REDEFINES FIELDDATE
15 FIELDDMM C 2
15 FIELDDDD C 2
15 FIELDDYY C 2
10 FIELDA C 3
10 FIELDB C 4
10 FIELDB C 5
10 FIELDD C 6
10 FIELDE C 7
05 FIELDF C 8
05 FIELDG C 9
... |
The change is just for FIELDDATE. All of the information can remain the same. In short taking older dates and changing other fields that are not part of the key is what is needed. The changing of the data outside the key has been accomplished. Changing the date part of the key or creating a new key from the old key is what is needed.
We use PGM=SORT. I think we have SYNCSORT, I have not dug it up in our JCL so far. I am still digging for other examples in our JCL.
The backup/reload option was looking like what I might need to do. But without a document for INSYNC, I was floundering a little. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
We still need actual input and output records that demonstrate the requirement. . . These do not need to be high-volume or full-length. Just enough to demonstrate the rules of th requirement. |
|
Back to top |
|
|
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
Condensed for space. Date of 041597 changed to 101010 (October 10th, 2010)
Code: |
CHANGED RECORD # 1
DATA BEFORE UPDATE DATA AFTER UPDATE
1 01 FIELDFD G
2 05 FIELDKEY G
3 10 FIELDDATE C 6 041597 101010 ***
4 10 FILLER G
5 15 FIELDMM C 2 04 10 ***
6 15 FIELDDD C 2 15 10 ***
7 15 FIELDYY C 2 97 10 ***
8 10 FIELDB C 3 ... ...
9 10 FIELDC C 4 0000 0000
10 10 FIELDD C 5 ..... .....
11 10 FIELDE C 6 ...... ......
12 10 FIELDF C 7 ....... .......
13 05 FIELDG C 8 ........ ........
14 05 FIELDH C 9 ......... ......... |
|
|
Back to top |
|
|
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
As previously stated.
The date field should be numeric. Which would indicate that it was a date field. This field has been verifed already as date formatted accurate. There are some records that contain non numeric information, these records are valid NOT to be changed. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
awkksgovus,
Its not clear (at least to me) what you're trying to achieve here. As suggested by dick, post a few records, may be 5-10 records and post the expected output along with the rules by which records have to be changed.
Quote: |
Date of 041597 changed to 101010 |
Why would it change to 101010 and not any other date? Or are you trying to hard code the date 101010 to all the records? If not, post your complete requirement and sample records using Code tags.
Quote: |
The date field should be numeric. Which would indicate that it was a date field |
Are you trying to say that, the date field has to be changed ONLY IF it has some valid numeric value, else the field is to be left untouched? |
|
Back to top |
|
|
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
The basic problem I think has already been addressed. Create a flat file from the VSAM. Sort/merge records to drop duplicates. Reload file either into the existing file or create a new file.
What I am NOT hearing is how to change the key on the file based on using numeric date range or just a numeric range to change only the keys that have a "date" in them.
It is a simple date change...
Insert your date here: MMDDYY (old record date can be anything in the past)
Insert your new date here: MMDDYY (this can be any date relative newer date It could be last monty of 091510 it could be a future date of 010111)
5 examples of the field being looked at simplified.
Code: |
OLD VALUE NEW VALUE CHANGE Y/N?
ABCDEF 101510 N
R 12 X 101510 N
041597 101510 Y
120102 101510 Y
060400 101510 Y |
5 examples of a different run for future dates
Code: |
OLD VALUE NEW VALUE CHANGE Y/N?
ABCDEF 012311 N
R 12 X 012311 N
101510 012311 Y
120102 012311 Y
101510 012311 Y |
We have older records that exist that have been processed. In short this is regression testing using new dates.
Records that do not have a valid date of MMDDYY. Are basically, redefined records that are accessed differently that records that have date as part of the key (in that date field). |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
how to change the key on the file based on using numeric date range or just a numeric range to change only the keys that have a "date" in them |
I appreciate the effort you have put in. But still it's really confusing. What do you mean by the above statement? numeric date range?
You need to post the actual input output records (showing relevant fields). Also you have shown two outputs for 2 different runs. Are you expecting different outputs on different runs for the same input?
Quote: |
We have older records that exist that have been processed. In short this is regression testing using new dates. |
These statements make sense only to you, nobody knows here what's your "regression testing" or what is meant by "processed" records.
Quote: |
It is a simple date change... |
May be..but not until you are able to explain it. Good luck |
|
Back to top |
|
|
awkksgovus
New User
Joined: 22 Jan 2010 Posts: 14 Location: Topeka, KS
|
|
|
|
Any field shown as "Old Value" that is numeric, is a date field. This field that contains a date, does not need to be verifed as a date.
If I had actual results I would not be here. I posted input, simple concept - if it is numeric - change/insert it to what you want. Yes 2 different runs as examples as someone questioned a 101010 date. The 2 examples show any younger date or future date to change for later testing. The "date" field is relevant, core and central to this change of data.
Simple date change: old MMDDYY to new MMDDYY format.
Sorry if you cannot see the requirement. |
|
Back to top |
|
|
|