Change all occurrences with JCL and FileManager
Change all occurrences with JCL and FileManager
Hello Folks,
I usually change files using FileManager through ISPF interface. Now I need to do this in a JCL. Via ISPF interface, I enter in FM option, 2 (Edit), open the file (VSAM) and execute command "change 'string1' 'string2' all". The strings have the same length. Do you know how to do this in a JCL?
Regards!
I usually change files using FileManager through ISPF interface. Now I need to do this in a JCL. Via ISPF interface, I enter in FM option, 2 (Edit), open the file (VSAM) and execute command "change 'string1' 'string2' all". The strings have the same length. Do you know how to do this in a JCL?
Regards!
Re: Change all occurrences with JCL and FileManager
I am trying with this JOB but when I run it, I get an error for missing or invalid control card.
Code: Select all
//JOBSIT1 JOB (999),'PROGRAMMER',
// CLASS=A,
// MSGCLASS=X,
// NOTIFY=&SYSUID,
// COND=(0,NE)
//STEP1 EXEC PGM=FILEMGR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
$$FILEM DSP DSNIN='PPG.TEST.LEKS.VS.CONTR',
$$FILEM CHANGE 'XXX' 'YYY' ALL
/*
//
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Change all occurrences with JCL and FileManager
what happened when You looked at the manual or pressed the PF1 key for interactive help ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort![Cool 8-)](./images/smilies/cool.gif)
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
![Cool 8-)](./images/smilies/cool.gif)
Re: Change all occurrences with JCL and FileManager
Hello enrico-sorichetti, I looked in the manual (PDF) and interactive help but I didn't get the answer. In the interactive help I read about command "CHANGE" but there is no information how to use it in a JCL. I don't even know how to make reference to the file.enrico-sorichetti wrote:what happened when You looked at the manual or pressed the PF1 key for interactive help ?
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Change all occurrences with JCL and FileManager
I'm looking at the FileManager manual and it indicates DSP is Data Set Print. Perhaps if you look in the manual at FCH (Find / CHange) instead of DSP, you would get further?
Re: Change all occurrences with JCL and FileManager
The manual is really difficult to use if one doesn't know how to search. Is there any tutorial? ![Sad :(](./images/smilies/sad.gif)
![Sad :(](./images/smilies/sad.gif)
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Change all occurrences with JCL and FileManager
Google is your friend. Googling file manager tutorial returns plenty of hits which you can go through to your heart's content. Furthermore, if you had bothered to check the FCH section of the File Manager manual (starting on page 1023 of the z/OS 13 manual) you could have found this example of how to use the CHANGE command in batch:
Code: Select all
//FMUSRFCH JOB (@TS2,MVS6),’FMNUSER’,NOTIFY=FMNUSER,
// CLASS=A,MSGLEVEL=(1,1),MSGCLASS=H
//FMNBAT EXEC PGM=FILEMGR
//STEPLIB DD DSN=FMNUSER.FMN110.TSTLOAD,DISP=SHR
// DD DSN=FMN.V1R1M0.TSTLOAD,DISP=SHR
// DD DSN=FMN.V1R1M0.SFMNMOD1,DISP=SHR
// DD DSN=FMN.IGYV1R20.SIGYCOMP,DISP=SHR
//SYSPRINT DD SYSOUT=*
//FMNEXEC DD DSN=FMN.EXEC,DISP=SHR
//FMNTSPRT DD SYSOUT=*
//FMNIN DD DSN=FMNUSER.JCL.TESTING,DISP=SHR
//SYSTERM DD SYSOUT=*
//SYSIN DD *
$$FILEM FCH ,
$$FILEM INPUT=FMNIN,MEMBER=J*
F ’rights reserved’
C ’Copyright 2001-2002’ ,
’Copyright 2001-2003’ 1 71
C ’Alpha Company Ltd’ ,
’Alpha Beta Company Ltd’ 1 71
C ’Beta Company Ltd’ ,
’Alpha Beta Company Ltd’ 1 71
/+
/*
Re: Change all occurrences with JCL and FileManager
And please do not post on multiple forums - there are answers on the other forum where I found your post.
Regards
Nic
Nic
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Change all occurrences with JCL and FileManager
IBM File Manager does have the capability to execute all the commands in batch too. It allows you to generate a Job of your choice - suggest you should also try generating the JCL and use that for future reference. IBM File Manger is, usually, tailored differently for different shop however the batch Job generated "automatically" will take care about any custom adjustment for your shop... fwiw.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: Change all occurrences with JCL and FileManager
Hello, Anuj! Yes, I read about all commands what you executes in FileManager have that capability, buy How do you generete that JCL?Anuj Dhawan wrote:IBM File Manager does have the capability to execute all the commands in batch too. It allows you to generate a Job of your choice - suggest you should also try generating the JCL and use that for future reference. IBM File Manger is, usually, tailored differently for different shop however the batch Job generated "automatically" will take care about any custom adjustment for your shop... fwiw.
Re: Change all occurrences with JCL and FileManager
Robert, the problem with those examples is I can not understand them. In this example, what are you trying to do? Do you always have to write $$FILEM FCH , or $FILEM <COMMAND> and in the other lines the parameters? I don't get what are you trying to do with MEMBER anyway :S.Robert Sample wrote:Google is your friend. Googling file manager tutorial returns plenty of hits which you can go through to your heart's content. Furthermore, if you had bothered to check the FCH section of the File Manager manual (starting on page 1023 of the z/OS 13 manual) you could have found this example of how to use the CHANGE command in batch:Code: Select all
//FMUSRFCH JOB (@TS2,MVS6),’FMNUSER’,NOTIFY=FMNUSER, // CLASS=A,MSGLEVEL=(1,1),MSGCLASS=H //FMNBAT EXEC PGM=FILEMGR //STEPLIB DD DSN=FMNUSER.FMN110.TSTLOAD,DISP=SHR // DD DSN=FMN.V1R1M0.TSTLOAD,DISP=SHR // DD DSN=FMN.V1R1M0.SFMNMOD1,DISP=SHR // DD DSN=FMN.IGYV1R20.SIGYCOMP,DISP=SHR //SYSPRINT DD SYSOUT=* //FMNEXEC DD DSN=FMN.EXEC,DISP=SHR //FMNTSPRT DD SYSOUT=* //FMNIN DD DSN=FMNUSER.JCL.TESTING,DISP=SHR //SYSTERM DD SYSOUT=* //SYSIN DD * $$FILEM FCH , $$FILEM INPUT=FMNIN,MEMBER=J* F ’rights reserved’ C ’Copyright 2001-2002’ , ’Copyright 2001-2003’ 1 71 C ’Alpha Company Ltd’ , ’Alpha Beta Company Ltd’ 1 71 C ’Beta Company Ltd’ , ’Alpha Beta Company Ltd’ 1 71 /+ /*
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Change all occurrences with JCL and FileManager
Me? I am doing NOTHING -- this example is straight out of the IBM manual and attributing anything about it to me is wrong. The example is working with a PDS named FMNUSER.JCL.TESTING -- and specifically only the members of this PDS that start with J -- and is finding occurrences of "rights reserved" in those members. The example is also changing "Copyright 2001-2002" to "Copyright 2001-2003" in columns 1 through 71 of the selected members of the PDS; changing "Alpha Company Ltd" to "Alpha Beta Company Ltd" in the same columns for the same members and changing "Beth Company Ltd" to "Alpha Beta Company Ltd" in the same columns for the same members.
This is not rocket science -- I've never had reason to use File Manager (although I do have extensive experience with File Aid) and hence my analysis is based purely upon understanding IT concepts and principles, and knowing mainframe data sets. If you cannot figure out what the File Manager JCL is doing from inspection, you REALLY need to ask yourself if you might want to pursue a career in a different field as this example JCL is pretty simple yet you have great difficultly in comprehending it. This example shows you how to write a change command in File Manager batch -- you should be able to experiment with it to determine the answers to your questions yourself. Make a back up copy of your data set so you can recover should you find the changes you try don't work as expected. If your data set is not a PDS, remove the MEMBER=J* from the sample JCL. Change the INPUT DD statement to point to your data set. Take out the FIND command. Test your changes.
And, finally, if you wish to ever become a professional IT person (as opposed to being a paid amateur like now), you need to learn how to read manuals, interpret syntax diagrams and find things out for yourself. Requiring your information to be spoon-fed to you does not improve your skills and definitely makes you less desirable to employers than someone who can figure things out themselves.
This is not rocket science -- I've never had reason to use File Manager (although I do have extensive experience with File Aid) and hence my analysis is based purely upon understanding IT concepts and principles, and knowing mainframe data sets. If you cannot figure out what the File Manager JCL is doing from inspection, you REALLY need to ask yourself if you might want to pursue a career in a different field as this example JCL is pretty simple yet you have great difficultly in comprehending it. This example shows you how to write a change command in File Manager batch -- you should be able to experiment with it to determine the answers to your questions yourself. Make a back up copy of your data set so you can recover should you find the changes you try don't work as expected. If your data set is not a PDS, remove the MEMBER=J* from the sample JCL. Change the INPUT DD statement to point to your data set. Take out the FIND command. Test your changes.
And, finally, if you wish to ever become a professional IT person (as opposed to being a paid amateur like now), you need to learn how to read manuals, interpret syntax diagrams and find things out for yourself. Requiring your information to be spoon-fed to you does not improve your skills and definitely makes you less desirable to employers than someone who can figure things out themselves.
Re: Change all occurrences with JCL and FileManager
Robert, I get this all the time
This is my code (relevant part):
I deleted "MEMBER" because is a VSAM file, and I specified columns between 0 and 50 because equals the length of all record (instead of ALL like the original command).
Code: Select all
0FMNBA091 Missing or invalid control card
0FMNBA092 Parameter $$FILEM missing
0FMNBE098 Keyword verification discontinued for any subsequent command
Code: Select all
//SYSIN DD *
$$FILEM FCH ,
$$FILEM INPUT=FMNIN,
C 'XXX' 'YYY' 0 50
/+
/*
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Change all occurrences with JCL and FileManager
Code: Select all
$$FILEM FCH ,
$$FILEM INPUT=FMNIN,MEMBER=J*
F ’rights reserved’
Code: Select all
$$FILEM FCH ,
$$FILEM INPUT=FMNIN,
C 'XXX' 'YYY' 0 50
Re: Change all occurrences with JCL and FileManager
Thanks Robert. You could be more nice in your answers, specially if this is a beginner forum.
Regards
Regards
Re: Change all occurrences with JCL and FileManager
This is not a beginners forum. There is another forum elsewhere that is for beginners.
Regards
Nic
Nic
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Change all occurrences with JCL and FileManager
it should mean that You KNOW HOW to use file managerI usually change files using FileManager through ISPF interface.
remember ...
we reply ON OUR TIME and FOR FREE
so it is our right to expect that people asking have done their homework
a paid consultant has the need and is expected to pick up all the s**t that the customer throws at him
we do not
![Mr. Green :mrgreen:](./images/smilies/bad.gif)
more time spent to show You what You should already know
![Mr. Green :mrgreen:](./images/smilies/bad.gif)
when You went to the file manager screen where it asks for the dataset name
did You notice ....
Code: Select all
Process Options Help
──────────────────────────────────────────────────────────────────────────────
File Manager Find/Change Utility
Command ===> Scroll PAGE
Input Partitioned, Sequential or VSAM Data Set, or HFS file:
Data set/path name ENRICO.MFTESTS.PS +
Member . . . . . (Blank - selection, pattern - process list)
Volume serial . (If not cataloged)
Record count . . Number of records to be searched
+ Additional options
Process List:
Sel Name Prompt Alias-of Size Created Changed ID
**** End of data ****
Code: Select all
Process Options Help
──────────────────────────────────────────────────────────────────────────────
File Manager Find/Change Utility
Command ===> C FROMSTRING TOSTRING Scroll PAGE
Input Partitioned, Sequential or VSAM Data Set, or HFS file:
Data set/path name ENRICO.MFTESTS.PS +
Member . . . . . (Blank - selection, pattern - process list)
Volume serial . (If not cataloged)
Record count . . Number of records to be searched
- Additional options
Listing data set . ENRICO.FM.LIST
Enter "/" to select option Listing Option ISPF Packing
JCL Source format Immediate change 1 1. Long 3 1. Asis
Use REXX proc / Batch execution 2. Summary 2. Pack
REXX no update / Directory integrity 3. Unpack
Advanced member selection Stats off 4. None
Binary mode, reclen CAPS initially on 5. Skip
Process List:
Sel Name Prompt Alias-of Size Created Changed ID
**** End of data ****
Code: Select all
EDIT ENRICO.SPFTEMP1.CNTL Columns 00001 00072
Command ===> Scroll ===> PAGE
****** ***************************** Top of Data ******************************
000001 //ENRICOB JOB (ESYZ),
000002 // ENRICO,MSGCLASS=A,
000003 // NOTIFY=ENRICO,CLASS=A,
000004 // MSGLEVEL=(1,1)
000005 //*
000006 //FILEMGR EXEC PGM=FMNMAIN
000007 //STEPLIB DD DSN=FMN.SFMNMOD1,DISP=SHR
000008 //* DD DSN=IGY.SIGYCOMP,DISP=SHR
000009 //*FMNCOB DD DUMMY Uncomment to force use of FM COBOL Compiler
000010 //*FMNCLERR DD SYSOUT=* Uncomment to force output of Compiler listing
000011 //SYSPRINT DD SYSOUT=*
000012 //FMNTSPRT DD SYSOUT=*
000013 //SYSTERM DD SYSOUT=*
000014 //SYSIN DD *
000015 $$FILEM FCH ,
000016 $$FILEM PACK=UNPACK,
000017 $$FILEM DIRINTEGR=YES,
000018 $$FILEM DSNIN=ENRICO.MFTESTS.PS
000019 C FROMSTRING TOSTRING
000020 /+
****** **************************** Bottom of Data ****************************
the +/- is sticky, it is kept in your Filemanager ISPF profile data
If You want to keep receiving help on any forum
You will have to definitely change Your attitude
otherwise Your chances of getting help will be almost non existent
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort![Cool 8-)](./images/smilies/cool.gif)
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
![Cool 8-)](./images/smilies/cool.gif)
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Change all occurrences with JCL and FileManager
Thanks for the detailed explanation Enrico.
Last edited by Anuj Dhawan on Wed Jun 17, 2015 3:20 pm, edited 1 time in total.
Reason: Moved the topic to File-AID and IBM File Manager part of the Forum.
Reason: Moved the topic to File-AID and IBM File Manager part of the Forum.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Global Moderator
- Posts: 826
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Change all occurrences with JCL and FileManager
for this TS the same consideration done here apply
http://www.zmainframes.com/viewtopic.php?f=35&t=1458
he asked a question, got a reply with a detailed explanation and did not care to acknowledge
these people have no place in a civil forum![Evil or Very Mad :evil:](./images/smilies/ireful.gif)
http://www.zmainframes.com/viewtopic.php?f=35&t=1458
he asked a question, got a reply with a detailed explanation and did not care to acknowledge
these people have no place in a civil forum
![Evil or Very Mad :evil:](./images/smilies/ireful.gif)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort![Cool 8-)](./images/smilies/cool.gif)
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
![Cool 8-)](./images/smilies/cool.gif)
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute