Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch REXX using IDCAMS ALLOC

Status
Not open for further replies.

rockpainter

Programmer
Oct 27, 2005
2
US
Limiation of IDCAMS ALLOC in batch...

In the "z/OS V1R6.0 DFSMS Access Method Services for Catalogs"
manual, Document Number: SC26-7394-03, topic '4.1 Restrictions' says:
.
- If the access method services job step contains either the SYSTSIN
or SYSTSPRT DD statements, the ALLOCATE command is unsuccessful.
Access method services allocates the SYSTSIN and SYSTSPRT DD
statements to pass the command to the TMP and to retrieve any error
messages that are issued. This is done for every ALLOCATE command.
Any TMP error messages appear in the SYSPRINT data set, and access
method services prints a summary message to show the final status
of the command.
.
However, batch TSO will not run without //SYSTSPRT. So we cannot
do IDCAMS ALLOC in batch TSO.

Work Around below... Comments please
Best Regards,
Bruce

Notice the ALLOC is TSO and the new GDG is rolled into the BASE by the
DUMMY REPRO...

//*
//JS01 EXEC PGM=IEBGENER
//PROIGN DD DUMMY
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&&SYSEXEC(TESTREX),DISP=(,PASS),UNIT=SYSALLDA,
// SPACE=(CYL,(5,5,5))
//SYSUT1 DD *,DLM=@@
/* rexx */
/* - - - - - - - - - - - - - - - - - - - - - - - */
/* House Keeping going into routine... */
/* - - - - - - - - - - - - - - - - - - - - - - - */
msg_status = MSG("OFF");
address TSO;
"FREE DD(INDD OUTDD)";
"FREE FI(SYSIN SYSPRINT)";
"FREE ATTRLIST(DCB01)";
msg_status = MSG("ON");

"ATTRIB DCB01 RECFM(F) LRECL(80) BLKSIZE(80)";
"ALLOC FILE(SYSIN) UNIT(WORK) SP(5,5) TRACK REUSE USING(DCB01)";
"ALLOC DD(SYSPRINT) SYSOUT";

"ALLOC DA('TEST.II.G0019V00') SHR DD(INDD)";

"ALLOC DA('TEST.II.G0020V00') DD(OUTDD)"||,
" LIKE('TEST.II.G0019V00')"||,
" SPACE(1,0) TRACKS BLKSIZE(6144)";

QUEUE ' REPRO - '
QUEUE ' INFILE(INDD) -'
QUEUE ' OUTFILE(OUTDD) -'
QUEUE ' COUNT(0)'
QUEUE ''

address TSO
"EXECIO * DISKW SYSIN (FINIS";
"CALL *(IDCAMS)" /* <-- Run IDCAMS */

/* - - - - - - - - - - - - - - - - - - - - - - - */
/* House Keeping going out of routine... */
/* - - - - - - - - - - - - - - - - - - - - - - - */
msg_status = MSG("OFF");
address TSO;
"FREE FI(SYSIN SYSPRINT)";
"FREE ATTRLIST(DCB01)";
"FREE DD(INDD OUTDD)";
msg_status = MSG("ON");
exit
@@
//JS02 EXEC PGM=IKJEFT1B,DYNAMNBR=30,REGION=0M
//PROIGN DD DUMMY
//SYSEXEC DD DSN=&&SYSEXEC,DISP=(OLD,DELETE)
//SYSTSPRT DD SYSOUT=8
//SYSTSIN DD *
PROF MSG
%TESTREX
 
Why not just run REPRO as a tso command? I believe that is acceptable...then there is no need to call IDAMS at all.

I will check it out for sure tomorrow at work, but I believe that should work.
 
--ALL-- IDCAMS commands are also valid TSO (i.e.: CLIST)commands. I wouldn't be surprised to find that IDCAMS and IKJEFT01 share a great deal of code under the covers. Sounds incestuous, doesn't it?

IKJEFT01 gives you a little more flexibility because it allows you to run CLIST and REXX as well, but anything you can do in IDCAMS you can also do in CLIST/REXX (given the proper environment).


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Didn't know that about TSO... have tested several IDCAMS commands without calling it and they work great... Thanks for the tip.

Have refined example Exec (Creating a new GDG) to just the following few lines of REXX:

//JS01 EXEC PGM=IEBGENER
//PROIGN DD DUMMY
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&&SYSEXEC(TESTREX),DISP=(,PASS),UNIT=SYSALLDA,
// SPACE=(CYL,(5,5,5))
//SYSUT1 DD *,DLM=@@
/* rexx */
trace i
/* - - - - - - - - - - - - - - - - - - - - - - - */
/* House Keeping going into routine... */
/* - - - - - - - - - - - - - - - - - - - - - - - */
msg_status = MSG("OFF");
address TSO;
"FREE DD(INDD OUTDD)";
msg_status = MSG("ON");
address TSO

"ALLOC DA('TEST.II.G0023V00') SHR DD(INDD)";

"ALLOC DA('TEST.II.G0024V00') DD(OUTDD)"||,
" LIKE('TEST.II.G0023V00')"||,
" SPACE(1,0) TRACKS BLKSIZE(6144) NEW CATALOG";

/* coding the NEW CATALOG is key to the process */

/* - - - - - - - - - - - - - - - - - - - - - - - */
/* House Keeping going out of routine... */
/* - - - - - - - - - - - - - - - - - - - - - - - */
msg_status = MSG("OFF");
address TSO;
"FREE DD(INDD OUTDD)";
msg_status = MSG("ON");
exit
@@
//JS02 EXEC PGM=IKJEFT1B,DYNAMNBR=30,REGION=0M
//PROIGN DD DUMMY
//SYSEXEC DD DSN=&&SYSEXEC,DISP=(OLD,DELETE)
//SYSTSPRT DD SYSOUT=8
//SYSTSIN DD *
PROF MSG
%TESTREX
/*

IBM Doc-O on the subject:

3.10.5.3 Rolling In a Generation Data Set © Copyright IBM Corp. 1987, 200
Topic lines 1 to 24 of 4

If you code DISP=(NEW,CATLG) for a system-managed GDG, when the system
allocates the data set, the system catalogs a new generation in a deferred
roll-in state. When the system performs end-of-job step processing, the
system rolls the deferred generation data set into the GDG.(very important statement)

Generation data sets can be in a deferred roll-in state if the job never reached the
end-of-job step or if they were allocated as DISP=(NEW,KEEP) and the data
set is not system managed. Generation data sets in a deferred roll-in
state can be referred to by their absolute generation numbers. You can use
the access method services command ALTER ROLLIN to roll in these
generation data sets.

Best Regards,
Bruce
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top