|
View previous topic :: View next topic
|
| Author |
Message |
M Lee Klein
New User
Joined: 08 Feb 2022 Posts: 39 Location: USA
|
|
|
|
I have a list of 100 datasets that need to be converted to all caps. I've been editing each dataset and entering UC2000 in the Line command area.
How would you automate this task? This is likely to be a continual need. |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
Feed the dataset list into a REXX which generates ISPF edits with an edit macro to do the work. This could even run as an ISPF batch job.
I believe that DF/SORT can also do uppercase translation, if so you need to generate a job to run the SORTs. ISPF skeleton services could do this fairly easily and the skeleton builder could run as an ISPF batch job. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
If the datasetnames are the same then modify this JCL, note that it assumes fixed-block lrecl 80.
| Code: |
//LTU PROC
//DSCOPY EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=<UDS,DISP=SHR
//SORTOUT DD DSN=<UDS,DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,80,TRAN=LTOU)
// PEND
//*
//S1 EXEC LTU,LTUDS=ds1
. . .
//S100 EXEC LTU,LTUDS=ds100 |
You can easily override the datasetlist in ISPF EDIT. |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| M Lee Klein wrote: |
| I have a list of 100 datasets that need to be converted to all caps. I've been editing each dataset and entering UC2000 in the Line command area. |
Better use Primary Command:
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| M Lee Klein wrote: |
I have a list of 100 datasets that need to be converted to all caps. I've been editing each dataset and entering UC2000 in the Line command area.
How would you automate this task? This is likely to be a continual need. |
There is a big difference: do you have this list of 100 datasets once in your life, or every day (or every week) you get new list of new 100 datasets?
Depending on the answer, it makes sense to choose either online solution (such as ISPF EDIT, etc.), or batch solution (such as SORT facility, etc.) |
|
| Back to top |
|
 |
M Lee Klein
New User
Joined: 08 Feb 2022 Posts: 39 Location: USA
|
|
|
|
These datasets change and are reoccurring. With manual editing, I can save the changes in the same dataset name.
If I use Sort, I create a new dataset name and delete the old, correct?
If REXX which generates ISPF edits with an edit macro, then saves in the same dataset name? |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
| M Lee Klein wrote: |
| If I use Sort, I create a new dataset name and delete the old, correct? |
Willy Jensen - a few postings above - has demonstrated very clearly: SORT can either create a new (copy) dataset, or override the old one. It's up to you.
ISPF EDIT usually makes the updates in-place; but with some tricks it also can create a copy of a dataset. |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
I have seen IBM advising not to use the same dataset for input and output, but I have done this lots of times over the years without any problems, so it might just be their lawyers speaking.
You can use the job here as a sample of generating the LTOU job using a batch ISPF skeleton builder. The dataset list is referenced by ddname DSLIST in the ISPBAT step. Of course, you could move the members in step 1 to SYSEXEC and ISPSLIB if this has to be done on a regular basis. It also demonstrates some of the lesser know features of skeletons, the ability to use TSO commands and the stack.
| Code: |
//U1 EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD UNIT=SYSDA,DISP=(,PASS),DSN=&&LIB,
// RECFM=FB,LRECL=80,BLKSIZE=0,SPACE=(TRK,(5,5,1))
//SYSIN DD DATA,DLM=@@
./ ADD NAME=MKJOB
Address Ispexec
"Control errors return"
"Ftopen"
if rc<>0 then exit xmsg('Ftopen rc' rc zerrlm)+8
else do
"Ftincl LTUSKEL"
cc=rc
if rc<>0 then say 'FtIncl LTUSKEL rc' rc zerrlm
"Ftclose"
rc=cc
end
exit xmsg('End rc' rc)+rc
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1)
./ ADD NAME=LTUSKEL
)TB 12
)REXX DSN COUNT
/* get dataset list */
address tso "execio * diskr dslist (finis)"
count=queued()
)ENDREXX
//LTUJOB JOB (1),'TEST',CLASS=A,COND=(0,LT),REGION=64M
//*
//LTU PROC
//DSCOPY EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&<UDS,DISP=SHR
//SORTOUT DD DSN=&<UDS,DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,80,TRAN=LTOU)
// PEND
//*
)DO N = 1 TO &COUNT
)REXX DSN
pull dsn
)ENDREXX
//S&N !EXEC LTU,LTUDS=&DSN
)ENDDO
@@
//*
//ISPBAT EXEC PGM=IKJEFT1B
//SYSEXEC DD DISP=SHR,DSN=&&LIB
//SYSTSPRT DD SYSOUT=*
//ISPMLIB DD DISP=SHR,DSN=ISP.SISPMENU
//ISPPLIB DD DISP=SHR,DSN=ISP.SISPPENU
//ISPSLIB DD DISP=SHR,DSN=&&LIB,UNIT=SYSDA,VOL=REF=*.SYSEXEC
// DD DISP=SHR,DSN=ISP.SISPSENU
//ISPTLIB DD DISP=SHR,DSN=ISP.SISPTENU
//ISPPROF DD UNIT=SYSDA,SPACE=(TRK,(5,5,4)),RECFM=FB,LRECL=80
//ISPLOG DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129
//ISPFILE DD SYSOUT=(A,INTRDR),RECFM=FB,LRECL=80,BLKSIZE=6240
//DSLIST DD DISP=SHR,DSN=Z.TEST.LTU.DSNLIST
//SYSTSIN DD *
ISPSTART CMD(MKJOB) |
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1441 Location: Bamberg, Germany
|
|
|
|
| We should be clear if the input is all of fixed length or variable. Depending on that, the method has to be chosen. Fixed length, I would chose a SORT PROC, otherwise EDIT MACRO, or whatever the USS hell has spawned to achieve the task (tr/sed/awk..). |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|