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 <IBM-MAIN@LISTSERV.UA.EDU> 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 00001
RECORD 00002
RECORD 00003

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

Reply via email to