Joined: 20 Jan 2011 Posts: 14 Location: Mumbai, India
Hi all
My Scenario is like I am copying my Controlcard to my input VSAM file. Then i am CICSSTARTing my Program RP9Z420 which call few of the programs and in return again back in RP9Z420 Output VSAm file is populated. I have to Copy this VSAM in to PS file.
Steps Written in JCL:
Note : COMTSIN is an input VSAM file and COMTSOT is an output VSAM file. Both are ESDS.
1) CLOSE/DISABLE - COMTSIN AND COMTSOT.
2) DELETE INPUT FILE COMTSIN
3) DEFINE INPUT FILE COMTSIN
4) DELETE INPUT FILE COMTSOT
5) DEFINE INPUT FILE COMTSOT
6) COPY CONTROL CARD TO VSAM FILE COMTSIN
7) Triggering or CICSSTART 'Z400' transaction which calls RP9Z420.
8) CLOSE/ENABLE- COMTSIN AND COMTSOT
9) COPY VSAM OUTPUT FILE TO PS FILE (utility used IDCAMS)
Now Actual Problem is : Output is written in Output VSAM file COMTSOT i.e JCL works properly till Step 8 . But as soon as Step 9 is executed it abends with an error "VSAM OPEN RETURN CODE IS 160".
This is because COMTSOT file which acts as an input for Step 9 is empty. Now Actually it is populated with data till Step 8 but it gets spaced out at Step 9. Could not figure out why it is happening like this.
Now if I copy that Step 9 in another JCL and Step 1 to Step 8 in another JCl and run both the JCL individually I See PS file is populated with output and it does not abend. But if all steps are kept in one JCL and JCl is submitted it abends with returmn code 160.
Please Help. Do let me know if more details required.
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
VSAM Open return Code 160 indicates that the file is empty. What do you mean by "spaced out"?
You don't have a OPEN/ENABLE between steps 6 and 7, so the Z400 task is likely to have an issue reading/writing the files (unless you explicitly coded OPEN/ENABLE in that task).
Joined: 20 Jan 2011 Posts: 14 Location: Mumbai, India
@Bill : Please find attached txt file AXU04. This will tell you how i open my Vsam files. It also has entire JCL that i have used. Guess this would clearify my question.
@Garry : Sorry I used a wrong word "Spaced out". I actually mean empty. Till Step 8 output file has data in it. When it enters step 9 output file which now acts as an input for step S9 becomes empty.
I forgot to mentiion we have Close enable step in between Step 6 and Step 7. I tried with open enable too but made no difference.
Updated steps:
1) CLOSE/DISABLE - COMTSIN AND COMTSOT.
2) DELETE INPUT FILE COMTSIN
3) DEFINE INPUT FILE COMTSIN
4) DELETE INPUT FILE COMTSOT
5) DEFINE INPUT FILE COMTSOT
6) COPY CONTROL CARD TO VSAM FILE COMTSIN
6A) CLOSE/ENABLE- COMTSIN AND COMTSOT
7) Triggering or CICSSTART 'Z400' transaction which calls RP9Z420.
8) CLOSE/ENABLE- COMTSIN AND COMTSOT
9) COPY VSAM OUTPUT FILE TO PS FILE (utility used IDCAMS)
Code for open/Clos: AXU04001/2/3 does open close of input and output file
Code for AXU04001:
APPLID=ARG(1)
APPLID2=ARG(2)
APPLID3=ARG(3)
TERMS=ARG(4)
SAY 'CONNECT TO' APPLID 'AS' TERMS
CALL CONNECT APPLID,TERMS
IF RC \=0 THEN DO
SAY 'ERROR:CICS' APPLID 'REGION IS NOT AVAILABLE.'
EXIT 00 /* SET RETURN CODE TO 00 */
END
ELSE DO /* IF ANY RETURN CODE IS NOT 0 SET RC TO 08 & EXIT */
SAY 'SUCCESSFULLY CONNECTED TO' APPLID
CALL CICSFC "CLOSE", "COMTSIN"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "DISABLE", "COMTSIN"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "CLOSE", "COMTSOT"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "DISABLE", "COMTSOT"; IF RESULT \=0 THEN EXIT 08
END
CALL DISCONNECT
RETURN 00 /* SET RETURN CODE TO 00 */
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
Quote:
Till Step 8 output file has data in it.
How? Have you not deleted an defined the file in steps 4 and 5 ?
Please do not use attachments - not everyone can download them (when I try, I get unformatted text which wraps around making it almost impossible to read). Please use "code tags" .
In the cunningly-named S6 step, you seem to concatenate a loadlib to the SYSPRINT DD. I've never done that, don't know what it'll do. Hopefully nothing or nothing bad.
EDIT: Presumably S7 is the OPEN/ENABLE, wrongly commented? Can you confirm/deny please?
FURTHER EDIT: If so to previous EDIT, then you are opening to CICS again in S10 (despite the comment again), which would cause the REPRO to fail. Note that the "160" isn't only "empty". What is the "reason code" given for the "160"?
Bill Step S6 works perfectly alright. COntrolcard is copied to input VSAM. Problem is with step where VSAM is copied to PS. here VSAM is empty which should not be. If I just remove that step and run a Jcl and check my output VSAM file it will have data in it.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Quote:
Step S6 works perfectly alright. COntrolcard is copied to input VSAM. Problem is with step where VSAM is copied to PS. here VSAM is empty which should not be. If I just remove that step and run a Jcl and check my output VSAM file it will have data in it.
I suggested that S6 was not the problem, but it still has what I consider an "error" in it - concatenating a loadlib to a SYSOUT=* dataset.
If you can re-read my previous post (I edited it twice, so maybe you didn't get it all) can you provide the answers please?
EDIT: Bit about using the Code tags deleted, as a kind moderator has already expended their effort doing that for you. Next time, code tags yourself please.
Joined: 20 Jan 2011 Posts: 14 Location: Mumbai, India
@Bill :
No Bil it is not wrongly commented. It is CLose/Enable. We are Close enabling the input and output VSAM file here at step S7.
This is what i get in spool on submitting the Jcl
Code:
IDCAMS SYSTEM SERVICES
REPRO INFILE(FILEIN)-
OUTFILE(FILEOUT)
IDC3300I ERROR OPENING CORP00VV.AGCY.COMM.TESTOUT.C
IDC3351I ** VSAM OPEN RETURN CODE IS 160
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
@garry:
Quote:
What happens if you add an IDCAMS step to VERIFY the file before you copy
Garry any step after S10 having output VSAm file as input for that step leads to error 160. So even Cant verify that. Hope I understood your question correct.
Most important: If I use that step S11 of JCL in another JCL and submit the job it works proper.data is copied to PS. Something is going wrong when it is used in same JCl.
Is it something like file not getting closed properly?
Joined: 20 Jan 2011 Posts: 14 Location: Mumbai, India
@Gary:
I executed JCl including step S10B and I got following error message:
Code:
IDCAMS SYSTEM SERVICES T
VERIFY FILE(FILEIN)
IDC3302I ACTION ERROR ON CORP00VV.AGCY.COMM.TESTOUT.C
IDC3351I ** VSAM I/O RETURN CODE IS 116 - RPLFDBWD = X'B0080074'
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
On Inquiring on net i found following explanation
"Attention message: the data set was not properly closed or was not opened. If the data set was not properly closed, then data may be lost if processing continues.
Gary we are closing our files in Step S10 but it still gives us this message.
This is what i have coded in AXU04002 of step S10
Code:
APPLID=ARG(1)
APPLID2=ARG(2)
APPLID3=ARG(3)
TERMS=ARG(4)
SAY 'CONNECT TO' APPLID 'AS' TERMS
CALL CONNECT APPLID,TERMS
IF RC \=0 THEN DO
SAY 'ERROR:CICS' APPLID 'REGION IS NOT AVAILABLE.'
EXIT 00 /* SET RETURN CODE TO 00 */
END
ELSE DO /* IF ANY RETURN CODE IS NOT 0 SET RC TO 08 & EXIT */
SAY 'SUCCESSFULLY CONNECTED TO' APPLID
CALL CICSFC "CLOSE", "COMTSIN"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "ENABLE", "COMTSIN"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "CLOSE", "COMTSOT"; IF RESULT \=0 THEN EXIT 08
CALL CICSFC "ENABLE", "COMTSOT"; IF RESULT \=0 THEN EXIT 08
END
CALL DISCONNECT
RETURN 00 /* SET RETURN CODE TO 00 */
Please do let me know whether i am closing it properly or not.
Thanks gary this discussion is leading us to some valid point.