IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UC Automation


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
M Lee Klein

New User


Joined: 08 Feb 2022
Posts: 39
Location: USA

PostPosted: Tue Feb 14, 2023 9:07 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Feb 14, 2023 11:13 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Tue Feb 14, 2023 11:27 pm
Reply with quote

ibmmainframes.com/viewtopic.php?t=23731&highlight=uppercase
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Feb 15, 2023 2:46 am
Reply with quote

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=&LTUDS,DISP=SHR       
//SORTOUT  DD DSN=&LTUDS,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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1257
Location: Bamberg, Germany

PostPosted: Wed Feb 15, 2023 9:47 am
Reply with quote

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:
Code:
C P'<' P'>' ALL
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Wed Feb 15, 2023 6:01 pm
Reply with quote

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
View user's profile Send private message
M Lee Klein

New User


Joined: 08 Feb 2022
Posts: 39
Location: USA

PostPosted: Wed Feb 15, 2023 7:36 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2024
Location: USA

PostPosted: Wed Feb 15, 2023 7:48 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Feb 15, 2023 8:25 pm
Reply with quote

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=&&LTUDS,DISP=SHR                           
//SORTOUT  DD DSN=&&LTUDS,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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1257
Location: Bamberg, Germany

PostPosted: Wed Feb 15, 2023 10:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts A very ingenious mainframe automation... CA Products 1
No new posts CA Workload Automation event code help CA Products 10
No new posts Automation of data entry using Rexx i... CLIST & REXX 4
This topic is locked: you cannot edit posts or make replies. Automation of data entry using Rexx i... CICS 0
Search our Forums:

Back to Top