Change HLQ of file being created



IBM's Command List programming language & Restructured Extended Executor

Re: Change HLQ of file being created

Postby willy jensen » Tue Jan 03, 2023 9:41 pm

Sure it will, just add the 'gdgnt' option to set the S99GDGNT flag in the S99FLAG1 field. See Table 5. Additional keys used for dynamic allocation in the 'Using REXX and z/OS UNIX System Services' manual.
sample:
 cc=bpxwdyn('alloc da(a.test.gdg(+1)) new catalog gdgnt',
             'lrecl(80) recfm(f,b) blksize(0)',            
             'tracks space(1,1) unit(sysda) dd(dd1) reuse')
                                                           
  cc=bpxwdyn('alloc da(a.test.gdg(+1)) new catalog gdgnt',
             'lrecl(80) recfm(f,b) blksize(0)',            
             'tracks space(1,1) unit(sysda) dd(dd1) reuse')

These users thanked the author willy jensen for the post:
Jeff R (Tue Jan 03, 2023 9:59 pm)
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

Re: Change HLQ of file being created

Postby Jeff R » Tue Jan 03, 2023 10:27 pm

now I'm trying to write the contents of the modified ISPSLIB member to the newly created GDS.
After the ISPSLIB member is modified, CLOSED and FREED, I reallocate it as DD2 and write to the GDS (DD1) :

ADDRESS TSO "ALLOC F(DD2) DA("FILE_NAME") SHR"
"EXECIO * DISKR DD2 (STEM RECORD. FINIS"
DO I = 1 TO RECORD.0
QUEUE RECORD.I
END
"EXECIO * DISKW DD1 (FINIS"
/* "EXECIO 0 DISKR DD1 (FINIS" */
/* "EXECIO 0 DISKR DD2 (FINIS" */
"FREE DDNAME(DD1)"
"FREE DDNAME(DD2)"
EXIT

the issue I get is I have to hit enter a second time for the REXX to complete
(the commented EXECIOs are just because I moved the FINIS to the DISKR/DISKW for DD1/DD2)
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Change HLQ of file being created

Postby willy jensen » Tue Jan 03, 2023 10:41 pm

There really is no reason to copy the stack to a stem, you can use the stack directly in the write, i.e.:
"newstack"
"EXECIO * DISKR DD2 (FINIS)"
"EXECIO" queued() "DISKW DD1 (FINIS)"
"delstack"

Note the NEWSTACK and DELSTACK commands, they are there just in case you already have something in the stack.
You might also get away with using the REPRO command, i.e.
zz=outtrap('lst.') /* avoid messages */
"repro infile(dd2) outfile(dd1)"
cc=rc /* I cant remember if outtrap sets the RC variable */
zz=outtrap('off')
if cc<>0 then say 'rc' cc 'text' lst.1

Note that the REPRO command does accept INDATASET(dsn) and OUTDATASET(dsn), so you can sometimes avoid the ALLOCATEs, but it allocates using DISP=OLD.

These users thanked the author willy jensen for the post:
Jeff R (Tue Jan 03, 2023 10:47 pm)
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

Re: Change HLQ of file being created

Postby willy jensen » Tue Jan 03, 2023 10:46 pm

I have to hit enter a second time for the REXX to complete

Nothing in the code shown should do that. Put in some SAYs or some TRACE R to determine where that extra prompt occurs.
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

Re: Change HLQ of file being created

Postby Jeff R » Tue Jan 03, 2023 10:48 pm

I went with the first option and that did eliminate the need to press ENTER a second time
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Change HLQ of file being created

Postby willy jensen » Tue Jan 03, 2023 10:49 pm

And then again - never ever use the '*' in EXECIO DISKW, always put a number in there. The '*' will stop when a null record is encountered, which might not be what you want.
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

Re: Change HLQ of file being created

Postby Jeff R » Wed Jan 04, 2023 2:13 am

Not sure if this is the appropriate place to ask this...
I have Skeleton (ISPSLIB) members with specific Jobnames (example UL04LBOX) but when the are submitted (via TSO SUBMIT) they always have my userid (UL04JDR) and an 'X' (i.e. UL04JDRX) as the Jobname
How do I get it to use the ISPSLIB member Jobname ?...I tried TSO SUBMIT file_name NOUSER but no difference
Jeff R
 
Posts: 27
Joined: Fri Dec 09, 2022 6:59 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Change HLQ of file being created

Postby Pedro » Wed Jan 04, 2023 2:26 am

re: jobname

I doubt that it is an ISPSLIB issue. Are you able to submit a job from a PDS, with a non-userid jobname?
Pedro Vera
User avatar
Pedro
 
Posts: 672
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 51 times

Re: Change HLQ of file being created

Postby willy jensen » Wed Jan 04, 2023 2:29 am

Or do a submit of the ispslib member directly from ispf 6?
Circumvention - build the job directly to INTRDR:
 cc=bpxwdyn('alloc sysout(a) writer(intrdr) dd(ispfile) reuse',
           'recfm(f,b) lrecl(80) blksize(6240)')              
 address ispexec "ftopen"
 address ispexec "ftincl" skelname
 address ispexec "ftclose"
 cc=bpxwdyn('free dd(ispfile)')  
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

Re: Change HLQ of file being created

Postby willy jensen » Wed Jan 04, 2023 2:42 am

One advantage with the ISPFILE -> INTRDR approach is that you are not limited to 80 bytes lrecl.
willy jensen
 
Posts: 419
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 61 times

PreviousNext

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post