View previous topic :: View next topic
|
Author |
Message |
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
abin
Active User
Joined: 14 Aug 2006 Posts: 198
|
|
|
|
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 |
|
|
karisurya
New User
Joined: 02 Aug 2007 Posts: 64 Location: Bangalore
|
|
|
|
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 |
|
|
|