Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

INSYNC key change/insert

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Fri Oct 15, 2010 1:48 am    Post subject: INSYNC key change/insert
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 15, 2010 2:25 am    Post subject:
Reply with quote

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
View user's profile Send private message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Fri Oct 15, 2010 8:26 pm    Post subject: INSYNC key change/insert
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Oct 15, 2010 8:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Fri Oct 15, 2010 9:04 pm    Post subject: Requirement example
Reply with quote

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
View user's profile Send private message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Fri Oct 15, 2010 9:20 pm    Post subject: PS INSYNC... requirement
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Fri Oct 15, 2010 11:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Sat Oct 16, 2010 12:16 am    Post subject: Not trying to be cryptic...
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Sat Oct 16, 2010 9:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
awkksgovus

New User


Joined: 22 Jan 2010
Posts: 14
Location: Topeka, KS

PostPosted: Tue Oct 19, 2010 2:15 am    Post subject:
Reply with quote

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. icon_redface.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us