IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UNIT=AFF for Easytrieve code


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gandikk

New User


Joined: 16 Mar 2017
Posts: 8
Location: Center Valley, PA

PostPosted: Wed Jul 12, 2017 11:42 pm
Reply with quote

Hi,

As there is a restriction on the number of tape drives that we can use per step, I tried to use UNIT=AFF in one of my Easytrieve step. I got S413 abend. Is there any issue with my code?

My Code:
Code:

//STEP01   EXEC PGM=EZTPA00,REGION=1024K
//SYSPRINT DD  SYSOUT=(,)
//SYSSNAP  DD  SYSOUT=(,)
//SYSOUT   DD  SYSOUT=(,),DCB=(LRECL=150,BLKSIZE=150)
//EZTVFM   DD  UNIT=SYSDA,SPACE=(CYL,(100,100))
//INF1     DD  DISP=SHR,DSN=INPUT1
//INF2     DD  DISP=SHR,DSN=INPUT2
//OUT1     DD  DSN=OUTPUT1,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(100,100),RLSE),
//             UNIT=CTAPE,VOL=(,,,99),
//             DCB=(RECFM=FB,LRECL=9,BLKSIZE=0)
//OUT2     DD  DSN=OUTPUT2,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(100,100),RLSE),
//             UNIT=AFF=OUT1,VOL=(,,,99),
//             DCB=(RECFM=FB,LRECL=9,BLKSIZE=0)

Thanks,
Gandikk

Coded after Mr. Sample's comment
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 12, 2017 11:51 pm
Reply with quote

I think you are dreadfully confused. If you are attempting to allocate a tape data set, why do you have SPACE coded? SPACE is ONLY for DASD data sets and has no meaning for tape. And why do you not have a LABEL parameter for the tape data sets? And why do you not not specify different file sequence numbers for the two output tape data sets? What is your site default retention period for tapes? Since you did not provide EXPDT or RETPD for your output tapes, the site default will set the length of time the tape will be kept -- and the site default may not be what you want.

Furthermore, you need to Code your JCL (using the Code button) to preserve spacing -- being new to the forum, you need to read and understand the forum rules and follow them.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Jul 13, 2017 12:22 am
Reply with quote

There is a restriction about the number of data sets that can be open on one tape volume at one time. It is one.

Now I have overused "one" in this post, and there are other reasons you can get a 413 ABEND. In the JESMSGLG data set in the job you should find an IEC145I message. Look up this message in the MVS System Messages manual for your z/OS release for more detailed information than we can supply in this forum. You should have done this before you started this thread.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jul 13, 2017 2:22 am
Reply with quote

Quote:
restriction on the number of tape drives that we can use per step

Well, except from the number of physically available drives, not at far as I know.
But, you specify UNIT=SYSAFF, which means that you want to reuse the same drive.
As to the S413, perhaps EZTPA00 doesn't close OUT1 before opening OUT2? That would certainly screw up the SYSAFF.
REGION=1024K is an awfully small region size in my opinion, but most likely not relevant to your problem.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Jul 13, 2017 7:32 am
Reply with quote

Ignoring the SPACE=... issue that Mr. Sample mentioned, the JCL, as written, will attempt to write the two output data sets on two different "scratch" volumes using one tape drive. The JCL would have to be different to define two different data sets on one volume.

Now, as Mr. Jensen observes, it seems likely that the first output data set is open when Easytrieve attempts to open the second output data set. You cannot do this. Hence the S413 ABEND.

Mr. Jensen's observation that, other than the physical availability of tape drives, there is no practical limit on the number of DD statements that specify a tape is correct. At least I never encountered this as a limiting issue in my career, though I have, from time to time, encountered issues with availability of physical tape drives, as, I'm sure, is also true with Mr. Jensen.

JCL to create two data sets on one tape volume, might be something like this.
Code:
//OUTPUT1  DD  DISP=(NEW,CATLG,DELETE),
//             UNIT=CTAPE,
//             VOL=(,RETAIN,,99),
//             LABEL=1,
//             DSN=OUTPUT1
//OUTPUT2  DD  DISP=(NEW,CATLG,DELETE),
//             UNIT=AFF=OUTPUT1,
//             VOL=(,,,99,REF=*.OUTPUT1),
//             LABEL=2,
//             DSN=OUTPUT2

The program must write the entitre OUTPUT1 data set, then close the data set, and then write the second data set.

JCL like this is common with sort.
Code:
//SORTIN   DD  DISP=OLD,
//             UNIT=TAPE,
//             VOL=SER=(vol,vol,vol),
//             DSN=INPUT
//SORTOUT  DD  DISP=(NEW,CATLG),
//             UNIT=AFF=*.SORTIN,
//             VOL=(,,,99),
//             DSN=OUTPUT
Back to top
View user's profile Send private message
gandikk

New User


Joined: 16 Mar 2017
Posts: 8
Location: Center Valley, PA

PostPosted: Fri Jul 14, 2017 11:35 pm
Reply with quote

Thank you mentors!!

Steve, I changed my code as per your suggestions. I got S513 abend this time. Looks like we can't open same tape drive at the same time for 2 separate files.
Code:

//STEP01   EXEC PGM=EZTPA00,REGION=1024K
//SYSPRINT DD  SYSOUT=(,)
//SYSSNAP  DD  SYSOUT=(,)
//SYSOUT   DD  SYSOUT=(,),DCB=(LRECL=150,BLKSIZE=150)
//EZTVFM   DD  UNIT=SYSDA,SPACE=(CYL,(100,100))
//EZMACLIB DD  DSN=DMK.TSOMACRO.DMS0PRTS,DISP=SHR
//INF1     DD  DISP=SHR,DSN=Input1
//INF2     DD  DISP=SHR,DSN=Input2
//OUT1     DD  DSN=Output1,
//             DISP=(NEW,CATLG,DELETE),LABEL=1,
//             UNIT=CTAPE,VOL=(,RETAIN,,99),
//             DCB=(RECFM=FB,LRECL=9,BLKSIZE=0)
//OUT2     DD  DSN=Output2,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=AFF=OUT1,LABEL=2,
//             DCB=(RECFM=FB,LRECL=9,BLKSIZE=0),
//             VOL=(,,,99,REF=*.OUT1)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jul 15, 2017 12:52 am
Reply with quote

Quote:
Looks like we can't open same tape drive at the same time for 2 separate files.

icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif icon_exclaim.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 15, 2017 1:11 am
Reply with quote

Quote:
Looks like we can't open same tape drive at the same time for 2 separate files.
That is why tape is considered serial media -- if you want to have two files open on the same volume at the same time, you use DASD because tape doesn't allow it. The read/write heads can only be at one spot on the tape, always (unless you plan on violating the laws of physics).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top