MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FILEMGR Utility

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
yatheesha.n
Beginner


Joined: 17 Mar 2017
Posts: 2
Topics: 1

PostPosted: Mon Mar 20, 2017 12:23 am    Post subject: FILEMGR Utility Reply with quote

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
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 11770
Topics: 74
Location: San Jose

PostPosted: Mon Mar 20, 2017 11:04 am    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yatheesha.n
Beginner


Joined: 17 Mar 2017
Posts: 2
Topics: 1

PostPosted: Tue Mar 21, 2017 12:54 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 993
Topics: 6
Location: At Home

PostPosted: Tue Mar 21, 2017 7:30 am    Post subject: Reply with quote

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.
_________________
Utility and Program control cards are NOt, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 11770
Topics: 74
Location: San Jose

PostPosted: Tue Mar 21, 2017 10:59 am    Post subject: Reply with quote

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

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group