Posted: Mon Mar 20, 2017 12:23 am Post subject: FILEMGR Utility
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.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Mar 20, 2017 11:04 am Post subject:
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
//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
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Tue Mar 21, 2017 7:30 am Post subject:
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.
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