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

To replace jobname in a file with another jobname.


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 89
Location: India

PostPosted: Wed Jan 18, 2023 1:12 pm
Reply with quote

Hi All ,

My requirement is i have a pds member (abc.xyz.t123(mem1) containing a jcl job with job name anything which is dynamic it could be anything.

I want to write a sort card to give this job name a constant job name lets say AFQGDG1 INSTEAD OF WHATEVER JOBNAME IS THERE IN JCL KEPT IN MEM1.

JCL: IN MEM1 (abc.xyz.t123(mem1)

//XYZ12345 --JOBNAME WHICH IS DYNAMIC

WANT TO REPLACE THIS JOBNAME WITH CONSTANT JOBNAME AFQGDG1
.

How i can achive this any idea i have already copied the pds (abc.xyz.t123(mem1) data into a flat file now looking for a sort card to do so.
Any hint appreciated.

Thanks
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Wed Jan 18, 2023 3:12 pm
Reply with quote

Sample:
Code:
OPTION COPY                                                     
INREC IFOUTLEN=80,IFTHEN=(WHEN=(1,79,SS,RE,                     
                    C'^//[$#@A-Z][$#@A-Z0-9]{0,7}[ ]+JOB[ ]+'),
  PARSE=(%01=(STARTAFT=C'//',ENDBEFR=BLANKS,FIXLEN=8),         
         %02=(FIXLEN=80)),                                     
  BUILD=(C'//AFQGDG1',2X,%02))                                 
END
Back to top
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 89
Location: India

PostPosted: Wed Jan 18, 2023 8:59 pm
Reply with quote

Thanks for your response.

i tried using above code but my step is failing.


Code:
//STEP02 EXEC PGM=SORT                                           
//SORTIN DD DSN=ALT0.GDG.INPUT.JCL1,DISP=SHR                     
//SYSOUT   DD SYSOUT=*                                           
//SORTOUT DD DSN=ALT0.GDG.INPUT.JCL2,                           
//             SPACE=(CYL,(1,1),RLSE),DCB=*.SORTIN,             
//             DISP=(NEW,CATLG,DELETE)                           
//SYSIN    DD *                                                 
 OPTION COPY                                                     
 INREC IFOUTLEN=80,IFTHEN=(WHEN=(1,79,SS,RE,                     
                     C'^//[$#@A-Z][$#@A-Z0-9]{0,7}[ ]+JOB[ ]+'),
   PARSE=(%01=(STARTAFT=C'//',ENDBEFR=BLANKS,FIXLEN=8),         
          %02=(FIXLEN=80)),                                     
   BUILD=(C'//AFQGDG6',2X,%02))                                 
 END                                                             
//STEP03 EXEC PGM=IEBGENER                                       




Error ;

Code:
IEF236I ALLOC. FOR M0022001 STEP02                                             
IGD103I SMS ALLOCATED TO DDNAME SORTIN                                         
IEF237I JES2 ALLOCATED TO SYSOUT                                               
IGD101I SMS ALLOCATED TO DDNAME (SORTOUT )                                     
        DSN (ALT0.GDG.INPUT.JCL2                         )                     
        STORCLAS (C) MGMTCLAS (Y02H1NNF) DATACLAS (NCSH)                       
        VOL SER NOS= TSQ573                                                   
IEF237I JES2 ALLOCATED TO SYSIN                                               
IEF237I JES2 ALLOCATED TO SPYSET                                               
IEF472I M0022001 STEP02 - COMPLETION CODE - SYSTEM=000 USER=0016 REASON=0000000
IGD104I ALT0.GDG.INPUT.JCL1                          RETAINED,  DDNAME=SORTIN 
IEF285I   DCSQBTCH.M0022001.JOB25559.D0000103.?        SYSOUT                 
IGD105I ALT0.GDG.INPUT.JCL2                          DELETED,   DDNAME=SORTOUT
IEF285I   DCSQBTCH.M0022001.JOB25559.D0000101.?        SYSIN                   
IEF285I   DCSQBTCH.M0022001.JOB25559.D0000105.?        SYSOUT                 
SURF930I STEP ENDED: JOB=M0022001 STEP=STEP02   PGM=SORT     ID=SH/00000/004 CC
                                                                               
Back to top
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 89
Location: India

PostPosted: Wed Jan 18, 2023 9:03 pm
Reply with quote

more errors:

Code:
 SYNCSORT FOR Z/OS  3.1.4.0R    U.S. PATENTS: 4210961, 5117495   (C) 2018 SYNCSO
                                                       z/OS   2.4.0             
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 13CD7, MODEL 8561 605             LICEN
 SYSIN :                                                                       
  OPTION COPY                                                                   
  INREC IFOUTLEN=80,IFTHEN=(WHEN=(1,79,SS,RE,                                   
                                          *                                     
                      C'.//.$#@A-Z..$#@A-Z0-9.{0,7}. .+JOB. .+'),               
    PARSE=(%01=(STARTAFT=C'//',ENDBEFR=BLANKS,FIXLEN=8),                       
           %02=(FIXLEN=80)),                                                   
    BUILD=(C'//AFQGDG6',2X,%02))                                               
  END                                                                           
 WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED                 
 WER251A  INCLUDE/OMIT INVALID COND                                             
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
Back to top
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 89
Location: India

PostPosted: Wed Jan 18, 2023 9:10 pm
Reply with quote

Adding on it ..

I just want to add constant job name AFQGDG* in place of job name which would be from coloumn 3 to 8 char maximum
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Wed Jan 18, 2023 9:22 pm
Reply with quote

Use Codepage 1047 for the RE terms, or it's equivalents. It works perfectly well in my test case.
Back to top
View user's profile Send private message
Digvijay Singh

New User


Joined: 20 Apr 2022
Posts: 89
Location: India

PostPosted: Wed Jan 18, 2023 10:11 pm
Reply with quote

Thanks for your response again.

I tried only running this sort card which you gave me and it is getting abended anyway I have no clue about this codepage.

I am doing more research how i can achive it.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 394
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Wed Jan 18, 2023 10:14 pm
Reply with quote

Does Syncsort support RE?
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Wed Jan 18, 2023 11:54 pm
Reply with quote

@Dave, question has been asked in DFSORT section. So one would expect solutions utilizing DFSORT features.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Thu Jan 19, 2023 12:22 am
Reply with quote

Simplified:
Code:
  OPTION COPY                                                   
  INREC IFOUTLEN=80,                                             
    IFTHEN=(WHEN=(1,2,CH,EQ,C'//',AND,                           
                  3,1,SS,EQ,C'$#@ABCDEFGHIJKLMNOPQRSTUVWXYZ',AND,
                  4,80,SS,EQ,C' JOB '),                         
    PARSE=(%01=(STARTAFT=C'//',ENDBEFR=BLANKS,FIXLEN=8),         
           %02=(FIXLEN=80)),                                     
    BUILD=(C'//AFQGDG1',2X,%02))                                 
  END

Add more checks for length and validity if required.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 394
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Thu Jan 19, 2023 2:54 am
Reply with quote

Joerg, Note WER messages earlier in this discussion
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Thu Jan 19, 2023 9:20 am
Reply with quote

dneufarth wrote:
Joerg, Note WER messages earlier in this discussion

I should have paid more attention on this, you are right.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2963
Location: NYC,USA

PostPosted: Thu Jan 19, 2023 11:30 am
Reply with quote

Moved to the right section.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts File Aid Batch IBM Tools 7
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Extract record using 2 input file int... JCL & VSAM 2
No new posts I want to append a record in an exist... CLIST & REXX 17
No new posts Selecting the max value from a file. DFSORT/ICETOOL 3
Search our Forums:

Back to Top