FILEMGR Utility
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: FILEMGR Utility Author: yatheesha.n PostPosted: Mon Mar 20, 2017 12:23 am
    —
Hi Guys,

I am working on a client requirement where client wants us to change ***CPYRF utility to FILEMGR.
Where input PDS contains a text message which is in unsorted format and length of 80 bytes which they want us to format to 103 record length using FILEMGR utility.

File looks like below:
Code:

000100104Thank you for your interest in ********* @@PRODUCT       
0002005 4**********d wants to be the only bank y
r need and we are committed to providing      0003000 4convenient quali
ts and services to our customers.  Some of the benefits of banking   


Result should be like this :
Code:

000100104Thank you for your interest in **********@@PRODUCT       
0002005  4******* wants to be the only bank you'll ever need and we
0003000  4convenient quality products and services to our customers.  So

Can some one help me please to code using FILEMGR utility.

Thanks,
In Adavance

#2:  Author: kolusuLocation: San Jose PostPosted: Mon Mar 20, 2017 11:04 am
    —
yatheesha.n,

It is not clear if you wnated to replace a text as your sample input file is

Either way if you want to expand a 80 byte file to 103 byte file then it is quite simple. You simply need to override the LRECL in the JCL and use set the PAD=ON which will pad the extra length with spaces(x'40'). If you want binary zeroes(X'00') instead of spaces(X'40'), then use PAD=OFF Here is a sample

Code:

//STEP0100 EXEC PGM=FILEMGR               
//SYSPRINT DD SYSOUT=*                   
//INFILE   DD DISP=SHR,DSN=Your Input FB80 byte file
//*
//DDOUT    DD DSN=Your output FB103 byte file,
//            DISP=(NEW,CATLG,DELETE),   
//            SPACE=(CYL,(1,1),RLSE),     
//            LRECL=103                   
//SYSIN    DD *                           
$$FILEM SET PAD=ON                       
$$FILEM DSC INPUT=INFILE OUTPUT=DDOUT     
//*                                       

If you need to change a certain word/character then you can use Fastproc with Rexxproc to change to a new dataset then use the following

Code:

//STEP0100 EXEC PGM=FILEMGR                 
//SYSPRINT DD SYSOUT=*     
//INFILE   DD DISP=SHR,DSN=Your Input FB80 byte file
//*
//DDOUT    DD DSN=Your output FB103 byte file,
//            DISP=(NEW,CATLG,DELETE),   
//            SPACE=(CYL,(1,1),RLSE),     
//            LRECL=103                     
//SYSIN    DD *                             
$$FILEM SET PAD=ON                           
$$FILEM DSC INPUT=INFILE,                   
$$FILEM  PROC=*                             
*FASTPROC                                   
OUTFIL FNAMES=DDOUT                         
*REXXPROC                                   
OUTREC = CHANGE(OUTREC,'chng string','new string ')         
//*


If you want in-place updates, then you can use FCH (find and Change) operator in file-manager

#3:  Author: yatheesha.n PostPosted: Tue Mar 21, 2017 12:54 am
    —
Code:

//SYSIN    DD *                           
$$FILEM SET PAD=ON                       
$$FILEM DSC INPUT=INFILE OUTPUT=DDOUT 

This will copy the PDS member data on to PS file but Its not formatting.

My requirement is I am having a PDS member which is of 80 Byte in length, But data is split into multiple line's, need to reformat using the data which is split and create n a single line of 103 bytes as shown below.

Example Input File(LRECL 80):
Code:

000001 000100104Thank you for your interest in ******** @@PRODUCT         
000002                        0002005 4********* wants to be the only bank you'll eve
000003 r need and we are committed to providing      0003000 4convenient quality produc
000004 ts and services to our customers.  Some of the benefits of banking   0004000 4wi
000005 h Fifth Third, one of the most successful banks in the country, includethe con
000006 enience of 0005000 4banking seven-days-a-week at full-service Banking Ce





Output Should be like this(LRECL 103):
Code:

000001 000100104Thank you for your interest in *********@@PRODUCT         
000002 0002005  4******** wants to be the only bank you'll ever need and we are committed to providing
000003 0003000 4convenient quality products and services to our customers.  Some of the benefits of banking
000004 0004000 4with *********, one of the most successful banks in the country, include the convenience of
000005 0005000 4banking seven-days-a-week at full-service Banking Centers located inside select grocery



Explanation:
000100104 already in first column
0002005 4 its in 24 th position in input file and line continues in 3rd line, hence in the out put it should be in 1st column of second line and data for 0002005 4 should be in single line. and same for other lines data too

#4:  Author: Nic CloustonLocation: At Home PostPosted: Tue Mar 21, 2017 7:30 am
    —
I do not know if what you require can be done using fFilemgr - but it looks as though it has a rexx interface. A rexx program can do this very easily:
join all the records into one long string - simple concatenation using ||
find the position of the SECOND "key" (the first is already at pos 1) use POS
Split the record into 2 parts Use SUBSTR or PARSE
Write the first part
Repeat the processing from 'find' until no more 'key' found
write the last part.

#5:  Author: kolusuLocation: San Jose PostPosted: Tue Mar 21, 2017 10:59 am
    —
yatheesha.n,

As Nic mentioned , you need rexxproc to concatenate multiple records into a single record and IMO File manager is not the right utility for this job.

DFSORT can create larger records from smaller records usign RESIZE. So here is a sample

Code:

//STEP0100 EXEC PGM=ICETOOL                           
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//IN       DD DISP=SHR,DSN=Your 80 byte input file
//OUT      DD SYSOUT=*                               
//TOOLIN   DD *                                       
  RESIZE FROM(IN) TO(OUT) TOLEN(103)
//*



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group