Page 1 of 1

Change all occurrences with JCL and FileManager

PostPosted: Tue Jun 16, 2015 1:13 am
by nico56
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? This is my job what I am trying to execute

//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
/*
//


But I am getting this error:

 1...5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
0FMNBA091 Missing or invalid control card
0FMNBA099 Invalid continuation, syntax error near card column  9


Regards!

Re: Change all occurrences with JCL and FileManager

PostPosted: Tue Jun 16, 2015 10:07 am
by Aki88
Hello Nico,

See if this helps; in FM, under the utilities (Option 3 in FM primary menu) option, there is a seperate option named- Find/Change (option 6 under 'Utilities').
This is how it appears:

File Manager                 Find/Change Utility                             
Command ===>                                                       Scroll CSR
                                                                             
Input Partitioned, Sequential or VSAM Data Set, or HFS file:                 
Data set/path name  'XXXX.YYYY.ZZZZ'                                +         
   Member . . . . .              (Blank - selection, pattern - process list) 
   Volume serial  .              (If not cataloged)                           
   Record count . .               Number of records to be searched           
- Additional options                                                         
Listing data set  . SRCHFOR.LIST                                             
                                                                             
Enter "/" to select option                        Listing Option  ISPF Packing
/ JCL Source format           Immediate change    1 1. Long       1 1. Asis   
  Use REXX proc             / Batch execution       2. Summary      2. Pack   
  REXX no update              Directory integrity Stats Option      3. Unpack
/ Advanced member selection                         1. Off          4. None   
  Binary mode, reclen         CAPS initially on     2. Force        5. Skip   


Select the batch execution tab, and punch in the usual CHANGE command in the command line followed by your strings.
Once you press ENTER, that should auto-build a tailored JCL for you; please note, for the JCL to be built, you need to select the 'Batch Execution' tab.

Hope this is what you are looking for.