Ah, INDEX was the parameter I needed.

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Bill Godfrey
Sent: Friday, September 15, 2023 4:31 PM
To: [email protected]
Subject: Re: Generate a data set with record numbers?

On Fri, 15 Sep 2023 20:19:32 +0000, Schmitt, Michael wrote:

For 80-byte records:

//DG      EXEC PGM=IEBDG
//SYSPRINT DD  SYSOUT=*
//OUTDD    DD  DSN=USERID.IEBDG.DATA,DISP=SHR
//SYSIN    DD  *
 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 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 [email protected] with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to