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
 

 

Update VSAM file using SYNCTOOL

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

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Tue Apr 14, 2009 3:23 pm    Post subject: Update VSAM file using SYNCTOOL
Reply with quote

Hi,
I have a VSAM File, and it basically contains 3 types records

CURRCYCLE 20090414
PREVCYCLE 20090413
FUTURCYCLE 20090415

What i need to do is create a JCL which will update the CURRCYCLE date to todays date - 1, PREVCYCLE date to todays date - 2 and it need to check if there is any entry under FUTURCYCLE with date greater than todays if not it should crete a new record similar to old record and update the correponding date to todays date + 1

Can any one please help me with this, please let me know in case if you need any further information.

Thanks,
Surya
Back to top
View user's profile Send private message

karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Tue Apr 14, 2009 6:13 pm    Post subject:
Reply with quote

Hi,
I created the following JCL to handle only issue related to CURRCYCLE in the above scenerio

Code:
                               
//STEP1    EXEC PGM=SYNCTOOL                                       
//IN1      DD  DSN=TSA9Z.SURYA.TEST,DISP=SHR                       
//T1       DD  DSN=&&TEMP,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1     DD  DSN=TSA9Z.SURYA.TEST,DISP=SHR                       
//DFSMSG   DD  SYSOUT=*                                           
//TOOLMSG  DD  SYSOUT=*                                           
//TOOLIN   DD  *                                                   
  COPY FROM(IN1) TO(T1) VSAMTYPE(F) USING(CTL1)                   
  COPY FROM(T1) TO(OUT1)                                           
/*                                                                 
//CTL1CNTL DD *                                                   
   INREC IFTHEN=(WHEN=(28,9,CH,EQ,C'CURRCYCLE'),                   
                  OVERLAY=(93:C'DATE1-1'))                         


But i am getting following error in this case


Code:

12K BYTES OF EMERGENCY SPACE ALLOCATED                           
T1       : RECFM=FB   ; LRECL=   123; BLKSIZE= 27921             
OUT1     : RECFM=F    ; LRECL=   123; CISIZE =  4096             
11,788K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
   0 BYTES RESERVE REQUESTED, 56K BYTES USED                     
VSAM LOGICAL ERROR 08 ON OUTPUT                                 
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                             


Can any one suggest what can be the problem with this one.

Thanks,
Surya
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Apr 14, 2009 6:22 pm    Post subject:
Reply with quote

1. you are updating a vsam file in place? why not output to a new vsam file.

2. are you changing part of the key?

3. not sure, don't remember, but does not an 08 indicate duplicate key insert attempt?
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Tue Apr 14, 2009 6:36 pm    Post subject:
Reply with quote

Hi,
Thank you for the quick response
Code:

1. you are updating a vsam file in place? why not output to a new vsam file.

This is a auditing file and presently i am doing manual update of these dates. This file is going to be used by various down stream applications so i wont be able to create a new vsam file

Code:

2. are you changing part of the key?

No i am not changing part of key

Code:

3. not sure, don't remember, but does not an 08 indicate duplicate key insert attempt?

I am not really sure either, but in one of the discussion it is mentioned that we will get this error when VSAM file was defined without REUSE. I am not sure how to check this one on my VSAM file?

Thanks,
Surya
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Apr 14, 2009 6:43 pm    Post subject:
Reply with quote

updating a file in place is 'not good practice'.

1. rename the original.
2. create a new one.
3. run your sort.

i am not an expert, but I don't think you can insert a duplicate record.....
which you are doing with the output of sort. (since you read the record and changed a part of the data portion.)


by the way, the design sucks.
you have a field that indicates what type of record it is.
you should have a control record to keep the dates in different fields (one for each record type).
then you only have to change one record.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Apr 14, 2009 6:46 pm    Post subject:
Reply with quote

Quote:
I am not really sure either, but in one of the discussion it is mentioned that we will get this error when VSAM file was defined without REUSE. I am not sure how to check this one on my VSAM file?
Does n't a LISTCAT show this? Still it's not clear what you're trying to do here. Can you post some sample input records showing the relevant fields and the expected output out of it?
Back to top
View user's profile Send private message
abin

Active User


Joined: 14 Aug 2006
Posts: 198

PostPosted: Wed Apr 15, 2009 2:01 am    Post subject:
Reply with quote

For the first thing you trying to read and write into the same VSAM file which as Dick said "sucks".

Try writing into a new vsam file and the error
Code:
VSAM LOGICAL ERROR 08 ON OUTPUT
can be removed.
This error says you are trying to write a duplicate record into VSAM file. Is your vsam file a KSDS. The error from your log says yes.

I tried the following sort card for an ESDS VSAm data set and it woked. With KSDS it will work if the o/p KSDS is empty.
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(5,9,CH,EQ,C'CURRCYCLE'),
OVERLAY=(15:DATE1-1))
Back to top
View user's profile Send private message
karisurya

New User


Joined: 02 Aug 2007
Posts: 64
Location: Bangalore

PostPosted: Wed Apr 15, 2009 5:15 pm    Post subject:
Reply with quote

Thank you all for the replies and suggestions, presently i am planning to acheive this in 2 steps.
1) In first step i will use sort, copy data from vsam to a temp. file with req. modifications
2) In second step I am using IDCAMS to update the VSAM file using this temp file.

Regarding design its done some 20 years back and i cant do much with respect to it.

Thanks& regards,
Surya
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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