Page 1 of 2

IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 3:00 pm
by Steve Coalbran
This is embarassing. I think the last IEBUPDTE I ran was a card deck!
I am after an example of the controls required to update the JOB card for a huge number of members of several JCL libraries.
Of course I could do this in REXX but I am guessing that IEBUPDTE would be a tad faster?
I have been trawling the IBM manuals for examples but so far come up empty.

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 3:36 pm
by Steve Coalbran
First highly unsuccessful attempt! :(
IEF033I  JOB/N472730A/STOP  2018128.1201                                      
         CPU:     0 HR  00 MIN  00.01 SEC    SRB:     0 HR  00 MIN  00.00 SEC  
1       SYSIN                            NEW MASTER                            
-       ./     CHANGE   NAME=JOBACUPT,LIST=ALL,UPDATE=INPLACE                  
        ./     NUMBER   SEQ1=ALL,NEW1=1,INCR=1                                  
 IEB802I I/O ERROR N472730A,STEP1   ,D7C1,D,SYSUT1  ,READ  ,OUT OF EXTENT  ,TTR
,***,*******,**********,00000008,0F055142,03                                    
 IEB818I HIGHEST CONDITION CODE WAS 00000012                                    
 IEB819I END OF JOB IEBUPDTE.                                                  
******************************** BOTTOM OF DATA ********************************

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 6:25 pm
by NicC
JCL? What you have so far (from reading the example in the manual) is OK. Just the data statement not shown. But is your PDS OK?

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 6:46 pm
by Steve Coalbran
Thanks Nic.
//A123456C JOB (SJ,P),'JOB AC CHANGE',CLASS=A,MSGCLASS=O,REGION=0M,
//         MSGLEVEL=(1,1),NOTIFY=&SYSUID,TIME=1440                  
/*JOBPARM  L=999999,CARDS=99999999                                  
//STEP1    EXEC PGM=IEBUPDTE,PARM=MOD                              
//SYSPRINT DD SYSOUT=*                                              
//SYSUT1   DD DISP=SHR,DSN=N472730.USER.JCL                        
//SYSIN    DD DATA,DLM='\\'                                        
./ CHANGE  NAME=JOBACUPT,LIST=ALL,UPDATE=INPLACE,SEQFLD=738        
./ NUMBER  SEQ1=00000001,NEW1=00000002,INCR=1                      
//A123456D JOB (SJ,P),'TEST AC CHANGE',CLASS=A,MSGCLASS=O            
\\

Everything I try gives RC=12 :roll: (time I retired?! :lol:)

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 6:52 pm
by NicC
Steve,
I do not see the sequence number thet it is supposed to replace. From the manual:
Data statement 1, sequence number 00000020


Don't know why you haven't retired!

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 6:57 pm
by steve-myers
Steve - I use IEBUPDTE quite a lot since it gives me a much higher degree of control over sequence numbers than ISPF, but only rarely UPDATE=INPLACE. Also, your use of SEQ1=ALL intrigued me; In 50+ years I've never used it

This seems rather baroque, but I did not want to risk damaging my source data set; this worked.

//A       EXEC PGM=IEBCOPY
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 C I=SYSUT1,O=SYSUT2
 S M=ADMIN
//SYSUT1   DD  DISP=SHR,DSN=&SYSUID..CNTL
//SYSUT2   DD  DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1,1))
//B       EXEC PGM=IEBUPDTE
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=(OLD,PASS),DSN=*.A.SYSUT2
//SYSIN    DD  *
./ CHANGE NAME=ADMIN,UPDATE=INPLACE
./ NUMBER SEQ1=ALL,NEW1=10,INCR=10
//C       EXEC PGM=IEBPTPCH
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DISP=(OLD,PASS),DSN=*.A.SYSUT2
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  *
 PRINT TYPORG=PO,MAXFLDS=1
 RECORD FIELD=(80,1,,21)
//D       EXEC PGM=TRACKSUM
//STEPLIB  DD  DISP=SHR,DSN=&SYSUID..LOAD
//SYSPRINT DD  SYSOUT=*
//INPUT    DD  DISP=(OLD,DELETE),DSN=*.A.SYSUT2


The TRACKSUM program in step D is a private utility to list a summary of the contents of the tracks in the input data set. I ran it to verify it really did the update in place. Its output was -
RELATIVE TRK  BYTES USED  UNUSED BYTES  TRK BALANCE  RECORD LENGTHS  
------------  ----------  ------------  -----------                  
 0000     0   0748  1864   DE5A 56922    D23E 53822  (8,256),0,1600,0
The (8,256) is the PDS directory; the 0 length record represents a DASD EOF record

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 7:35 pm
by Steve Coalbran
NicC wrote:Steve,
I do not see the sequence number...
I don't know. There are many libraries to process. I have no idea if the member I am updating is NUM ON or NUM OFF or UNNUM.
I just want to update the first record, in this case the JOB card. Thinking it would probably be #1?

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 7:41 pm
by Steve Coalbran
steve-myers wrote:...I use IEBUPDTE quite a lot...
Thanks Steve,
I don't really follow this example. It looks terribly complicated to just change the first record of a member which is all I need.
I am already thinking I can copy the whole member much more easily using IEBCOPY?

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 7:43 pm
by steve-myers
My little example was to do the ./ NUMBER as you tried without any risk of damaging my real library. I think you are right to number the member, otherwise you can't update just the first record. I said my example was rather too complicated up front, but it was complicated for two reasons.
  1. I did not want to risk damaging the "production" library, which has dozens of members of varying size that I don't want to lose. The I/O error you got rather frightened me.
  2. It allowed me to run TRACKSUM with a reasonable chance of analyzing the output. While I did not show intermediate runs I detected a run without UPDATE=INPLACE which might have embarrassed me had I posted it.
The member I numbered was just a small member I had no good reason to update. In fact, I'm not sure why it was saved in the first place!

Re: IEBUPDTE to update 1st record in a JOB library

PostPosted: Tue May 08, 2018 7:46 pm
by Steve Coalbran
steve-myers wrote:My little example was to do the
I think you went SD37 there Steve?