Re: Generate a data set with record numbers?
I needed to code a IRXJCL yesterday and wanted to use an instream exec. I remembered there was a message last year about this, but couldn't get it to work. The manual CLEARLY SAYS that SYSEXEC *must* be a library. So I hunted back through the archives until I found the message, and that's when I noticed that the linked documentation was for z/OS 2.5. -Original Message- From: IBM Mainframe Discussion List On Behalf Of Paul Gilmartin Sent: Tuesday, February 6, 2024 5:30 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? On Tue, 6 Feb 2024 16:18:16 -0600, Michael Schmitt wrote: >Reason I never knew you could have a sequential SYSEXEC is I'm on z/OS 2.4. >This capability is added in z/OS 2.5. > It has long been possible according to lore. A resourceful programmer looked at the control block description where was documented that if the member was 8x'00' SYSEXEC was treated as sequential and tried forcing that in JCL. IBM learned that programmers were doing that and finally documented it. >On Mon, 18 Sep 2023 15:25:47 +, Schmitt, Michael wrote: > September? Delayed reaction!? >>Huh. I always thought that SYSEXEC had to be a library. >> >>I suppose a sequential SYSEXEC only works for IRXJCL, not IKJEFT01. > Only because TSO syntax regards 8x'00' as an invalid member name, but the JCL reader never bothered to check. What about other unconventional member names that might be created with Assembler STOW? >...And that if SYSEXEC is sequential, the exec shouldn't call other execs. >> They could reside in SYSPROC. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
On Tue, 6 Feb 2024 16:18:16 -0600, Michael Schmitt wrote: >Reason I never knew you could have a sequential SYSEXEC is I'm on z/OS 2.4. >This capability is added in z/OS 2.5. > It has long been possible according to lore. A resourceful programmer looked at the control block description where was documented that if the member was 8x'00' SYSEXEC was treated as sequential and tried forcing that in JCL. IBM learned that programmers were doing that and finally documented it. >On Mon, 18 Sep 2023 15:25:47 +, Schmitt, Michael wrote: > September? Delayed reaction!? >>Huh. I always thought that SYSEXEC had to be a library. >> >>I suppose a sequential SYSEXEC only works for IRXJCL, not IKJEFT01. > Only because TSO syntax regards 8x'00' as an invalid member name, but the JCL reader never bothered to check. What about other unconventional member names that might be created with Assembler STOW? >...And that if SYSEXEC is sequential, the exec shouldn't call other execs. >> They could reside in SYSPROC. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Reason I never knew you could have a sequential SYSEXEC is I'm on z/OS 2.4. This capability is added in z/OS 2.5. On Mon, 18 Sep 2023 15:25:47 +, Schmitt, Michael wrote: >Huh. I always thought that SYSEXEC had to be a library. > >I suppose a sequential SYSEXEC only works for IRXJCL, not IKJEFT01. And that >if SYSEXEC is sequential, the exec shouldn't call other execs. > >-Original Message- >From: IBM Mainframe Discussion List On Behalf Of >Beate Kawelke >Sent: Monday, September 18, 2023 1:47 AM >To: IBM-MAIN@LISTSERV.UA.EDU >Subject: AW: Generate a data set with record numbers? > >Hi Michael, > >you could directly run the REXX as in-stream in the JCL: >https://www.ibm.com/docs/en/zos/2.5.0?topic=routine-using-irxjcl-execute-in-stream-rexx-exec > >Best regards, >Beate > >-Urspr�ngliche Nachricht- >Von: IBM Mainframe Discussion List Im Auftrag von >Schmitt, Michael >Gesendet: Freitag, 15. September 2023 22:20 >An: IBM-MAIN@LISTSERV.UA.EDU >Betreff: [IBM-MAIN] Generate a data set with record numbers? > >I want to generate a data set that has the record number on each line, such as: > >RECORD 1 >RECORD 2 >RECORD 3 > >Or > >RECORD 1 >RECORD 2 >RECORD 3 > >Perhaps I want to generate 1,000 records. Or 10,000. > >The question is, what's the simplest way to do this with a *standard* z/OS >utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >DFSORT or SyncSort), where it is all in a self-contained job? > >I thought of IEBDG or IEBGENER but I don't see where you can tell it to >generate a sequence number in the records it is building. Is it there and I'm >just missing it? > > >I came up with two solutions: > >A. IEBGENER to copy instream REXX into a PDS, then IRXJCL to execute it. The >REXX exec generates the records. > >Or > >B. IEBDG to generate a file of N records that just say "RECORD", followed by a >SORT that uses INREC to modify the record to contain the RECNUM. The sort >would just copy the records. > > >Both of these solutions are two steps. > >I'm curious if there's a simpler solution that I haven't thought of. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
+1 I have always admired the product but I have really a hard time using the manual effectively. It leaves MUCH to be desired. Peter From: IBM Mainframe Discussion List On Behalf Of Schmitt, Michael Sent: Monday, September 18, 2023 10:52 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? Thanks, "REPEAT" was what I was looking for. I think the SyncSort MFX manual is in the top 2 (bottom 2?) for hardest to figure out capabilities and syntax. -Original Message- From: IBM Mainframe Discussion List On Behalf Of Sri h Kolusu Sent: Friday, September 15, 2023 5:01 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? >> The question is, what's the simplest way to do this with a *standard* z/OS >> utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >> DFSORT or SyncSort), where it is all in a self-contained job? Michael, DFSORT can generate the sequenced records quite easily. Use the following JCL. It will generate an 8 byte sequence number. You can change the REPEAT=n to the desired number of records that you want. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ABC //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY OUTFIL REPEAT=1000, BUILD=(C'RECORD ',SEQNUM,8,ZD) /* If you want the leading zeroes suppressed then you can use FS format instead of ZD Thanks, Kolusu DFSORT Development IBM Corporation -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Huh. I always thought that SYSEXEC had to be a library. I suppose a sequential SYSEXEC only works for IRXJCL, not IKJEFT01. And that if SYSEXEC is sequential, the exec shouldn't call other execs. -Original Message- From: IBM Mainframe Discussion List On Behalf Of Beate Kawelke Sent: Monday, September 18, 2023 1:47 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: AW: Generate a data set with record numbers? Hi Michael, you could directly run the REXX as in-stream in the JCL: https://www.ibm.com/docs/en/zos/2.5.0?topic=routine-using-irxjcl-execute-in-stream-rexx-exec Best regards, Beate -Ursprüngliche Nachricht- Von: IBM Mainframe Discussion List Im Auftrag von Schmitt, Michael Gesendet: Freitag, 15. September 2023 22:20 An: IBM-MAIN@LISTSERV.UA.EDU Betreff: [IBM-MAIN] Generate a data set with record numbers? I want to generate a data set that has the record number on each line, such as: RECORD 1 RECORD 2 RECORD 3 Or RECORD 1 RECORD 2 RECORD 3 Perhaps I want to generate 1,000 records. Or 10,000. The question is, what's the simplest way to do this with a *standard* z/OS utility (i.e. that comes with z/OS), or with a standard sort product (e.g. DFSORT or SyncSort), where it is all in a self-contained job? I thought of IEBDG or IEBGENER but I don't see where you can tell it to generate a sequence number in the records it is building. Is it there and I'm just missing it? I came up with two solutions: A. IEBGENER to copy instream REXX into a PDS, then IRXJCL to execute it. The REXX exec generates the records. Or B. IEBDG to generate a file of N records that just say "RECORD", followed by a SORT that uses INREC to modify the record to contain the RECNUM. The sort would just copy the records. Both of these solutions are two steps. I'm curious if there's a simpler solution that I haven't thought of. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Thanks, "REPEAT" was what I was looking for. I think the SyncSort MFX manual is in the top 2 (bottom 2?) for hardest to figure out capabilities and syntax. -Original Message- From: IBM Mainframe Discussion List On Behalf Of Sri h Kolusu Sent: Friday, September 15, 2023 5:01 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? >> The question is, what's the simplest way to do this with a *standard* z/OS >> utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >> DFSORT or SyncSort), where it is all in a self-contained job? Michael, DFSORT can generate the sequenced records quite easily. Use the following JCL. It will generate an 8 byte sequence number. You can change the REPEAT=n to the desired number of records that you want. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ABC //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY OUTFIL REPEAT=1000, BUILD=(C'RECORD ',SEQNUM,8,ZD) /* If you want the leading zeroes suppressed then you can use FS format instead of ZD Thanks, Kolusu DFSORT Development IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Ah, INDEX was the parameter I needed. -Original Message- From: IBM Mainframe Discussion List On Behalf Of Bill Godfrey Sent: Friday, September 15, 2023 4:31 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? On Fri, 15 Sep 2023 20:19:32 +, Schmitt, Michael wrote: For 80-byte records: //DG EXEC PGM=IEBDG //SYSPRINT DD SYSOUT=* //OUTDDDD DSN=USERID.IEBDG.DATA,DISP=SHR //SYSINDD * DSD OUTPUT=(OUTDD) FD NAME=REC,LENGTH=7,STARTLOC=1,PICTURE=7,'RECORD ' FD NAME=SEQ,LENGTH=5,FORMAT=ZD,INDEX=1 FD NAME=PAD,LENGTH=68,STARTLOC=13,FILL=X'40' CREATE QUANTITY=100,NAME=(REC,SEQ,PAD) >I want to generate a data set that has the record number on each line, such as: > >RECORD 1 >RECORD 2 >RECORD 3 > >Or > >RECORD 1 >RECORD 2 >RECORD 3 > >Perhaps I want to generate 1,000 records. Or 10,000. > >The question is, what's the simplest way to do this with a *standard* z/OS >utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >DFSORT or SyncSort), where it is all in a self-contained job? > >I thought of IEBDG or IEBGENER but I don't see where you can tell it to >generate a sequence number in the records it is building. Is it there and I'm >just missing it? > > >I came up with two solutions: > >A. IEBGENER to copy instream REXX into a PDS, then IRXJCL to execute it. The >REXX exec generates the records. > >Or > >B. IEBDG to generate a file of N records that just say "RECORD", followed by a >SORT that uses INREC to modify the record to contain the RECNUM. The sort >would just copy the records. > > >Both of these solutions are two steps. > >I'm curious if there's a simpler solution that I haven't thought of. > -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
>> The question is, what's the simplest way to do this with a *standard* z/OS >> utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >> DFSORT or SyncSort), where it is all in a self-contained job? Michael, DFSORT can generate the sequenced records quite easily. Use the following JCL. It will generate an 8 byte sequence number. You can change the REPEAT=n to the desired number of records that you want. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD * ABC //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY OUTFIL REPEAT=1000, BUILD=(C'RECORD ',SEQNUM,8,ZD) /* If you want the leading zeroes suppressed then you can use FS format instead of ZD Thanks, Kolusu DFSORT Development IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
On Fri, 15 Sep 2023 20:55:21 +, Schmitt, Michael wrote: >Can you run the shell script from JCL? > Probably as STDENV to BPXBATCH. Simpler as STDIN to COZBATCH or AOPBATCH, but those aren't base z/OS utilities. >-Original Message- >From: Paul Gilmartin >Sent: Friday, September 15, 2023 3:45 PM > >#! /bin/sh +x > >R=0 >while R=$(( R + 1 )); [ 10 -ge $R ] >do >echo "Record $R" >done -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
On Fri, 15 Sep 2023 20:19:32 +, Schmitt, Michael wrote: For 80-byte records: //DG EXEC PGM=IEBDG //SYSPRINT DD SYSOUT=* //OUTDDDD DSN=USERID.IEBDG.DATA,DISP=SHR //SYSINDD * DSD OUTPUT=(OUTDD) FD NAME=REC,LENGTH=7,STARTLOC=1,PICTURE=7,'RECORD ' FD NAME=SEQ,LENGTH=5,FORMAT=ZD,INDEX=1 FD NAME=PAD,LENGTH=68,STARTLOC=13,FILL=X'40' CREATE QUANTITY=100,NAME=(REC,SEQ,PAD) >I want to generate a data set that has the record number on each line, such as: > >RECORD 1 >RECORD 2 >RECORD 3 > >Or > >RECORD 1 >RECORD 2 >RECORD 3 > >Perhaps I want to generate 1,000 records. Or 10,000. > >The question is, what's the simplest way to do this with a *standard* z/OS >utility (i.e. that comes with z/OS), or with a standard sort product (e.g. >DFSORT or SyncSort), where it is all in a self-contained job? > >I thought of IEBDG or IEBGENER but I don't see where you can tell it to >generate a sequence number in the records it is building. Is it there and I'm >just missing it? > > >I came up with two solutions: > >A. IEBGENER to copy instream REXX into a PDS, then IRXJCL to execute it. The >REXX exec generates the records. > >Or > >B. IEBDG to generate a file of N records that just say "RECORD", followed by a >SORT that uses INREC to modify the record to contain the RECNUM. The sort >would just copy the records. > > >Both of these solutions are two steps. > >I'm curious if there's a simpler solution that I haven't thought of. > -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
You can run the below in batch and point systsprt to disk /* REXX */ do x = 1 to 100 Say "RECORD " || X End -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Look up the SEQNUM operand in your sort reference -Original Message- From: IBM Mainframe Discussion List On Behalf Of Schmitt, Michael Sent: Friday, September 15, 2023 1:20 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Generate a data set with record numbers? I want to generate a data set that has the record number on each line, such as: RECORD 1 RECORD 2 RECORD 3 Or RECORD 1 RECORD 2 RECORD 3 Perhaps I want to generate 1,000 records. Or 10,000. The question is, what's the simplest way to do this with a *standard* z/OS utility (i.e. that comes with z/OS), or with a standard sort product (e.g. DFSORT or SyncSort), where it is all in a self-contained job? I thought of IEBDG or IEBGENER but I don't see where you can tell it to generate a sequence number in the records it is building. Is it there and I'm just missing it? I came up with two solutions: A. IEBGENER to copy instream REXX into a PDS, then IRXJCL to execute it. The REXX exec generates the records. Or B. IEBDG to generate a file of N records that just say "RECORD", followed by a SORT that uses INREC to modify the record to contain the RECNUM. The sort would just copy the records. Both of these solutions are two steps. I'm curious if there's a simpler solution that I haven't thought of. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
Can you run the shell script from JCL? I should have made it clear I need to have the JCL generate the data set each time it is run. If I just wanted to do it one time, I would just use ISPF Edit: 1. NUM ON 2. type "Record" 3. Repeat 999 4. NUM OFF 5. Shift the sequence numbers Meanwhile I completed the IEBDG, SORT solution: IEBDG: DSD OUTPUT=(SYSUT2) CREATE QUANTITY=1000,FILL=' ',PICTURE=6,1,'Record' END SORT: INREC OVERLAY=(8:SEQNUM,4,ZD) SORT FIELDS=COPY -Original Message- From: IBM Mainframe Discussion List On Behalf Of Paul Gilmartin Sent: Friday, September 15, 2023 3:45 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Generate a data set with record numbers? On Fri, 15 Sep 2023 20:19:32 +, Schmitt, Michael wrote: >I want to generate a data set that has the record number on each line, such as: > >RECORD 1 >RECORD 2 >RECORD 3 > A shell solution: #! /bin/sh +x R=0 while R=$(( $R + 1 )); [ 10 -ge $R ] do echo "Record $R" done I'm confident you'll get alternatives in REXX and DFSORT. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Generate a data set with record numbers?
On Fri, 15 Sep 2023 20:19:32 +, Schmitt, Michael wrote: >I want to generate a data set that has the record number on each line, such as: > >RECORD 1 >RECORD 2 >RECORD 3 > A shell solution: #! /bin/sh +x R=0 while R=$(( $R + 1 )); [ 10 -ge $R ] do echo "Record $R" done I'm confident you'll get alternatives in REXX and DFSORT. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN