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 

Copy plus replace

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
haseen_mohammed
Beginner


Joined: 20 Feb 2006
Posts: 27
Topics: 14

PostPosted: Fri Sep 07, 2007 5:19 am    Post subject: Copy plus replace Reply with quote

Hi All,

Can any of you kindly help me with this.

Problem:
Following is sample input file -

VOL1P11906 INDI EFT CHARGING 999999
HDR1A999999S 1 P1190600010001 2007-08-31 2007-09-06
HDR2F0195000130 00
UHL12007-09-069999950006EFT 2007-08-01
XXXXXXXXXXXXXXData RecoordsXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXData RecoordsXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXData RecoordsXXXXXXXXXXXXXXXXXXXX
EOF1A999999S 1 P1190600010001 2007-08-31
EOF2F0195000130
UTL1000011667309500000000000000000000000000000000000

Following should be the output

VOL1P11906 INDI FPS CHARGING 999999
HDR1A999999S 1 P1190600010001 2007-08-31 2007-09-06
HDR2F0195000130 00
UHL12007-09-069999950006FPS 2007-08-01
EOF1A999999S 1 P1190600010001 2007-08-31
EOF2F0195000130
UTL1000000000000000000000000000000000000000000000000

1) EFT gets changed to FPS
2) Only headers and trailers are retained
3) All records between header and trailers are dropped
4) Number after UTL1 at the end becomes zero.
5) FYI .. HDR1, HDR2, UHL1, EOF1, EOF2 and UTL1 are constants and will always remain in these lines.

Can someone kindly let me know how to achieve this.

Regards,
Haseen
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Fri Sep 07, 2007 5:27 am    Post subject: Reply with quote

Can I assume that these are not real tape labels with tape marks embedded?

Either sort has the function you need, which one is available?
Back to top
View user's profile Send private message
haseen_mohammed
Beginner


Joined: 20 Feb 2006
Posts: 27
Topics: 14

PostPosted: Fri Sep 07, 2007 6:10 am    Post subject: Reply with quote

These are sample files and not any tape records.

I was looking for a sort / dfsort / icetool to achive this.

Please let me know in case you need more details.

Regards,
Akshay
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Sep 07, 2007 7:33 am    Post subject: Reply with quote

haseen_mohammed,

Please try this code:

Code:


   //STEP1    EXEC PGM=SORT                                           
//*                                                               
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
VOL1P11906 INDI EFT CHARGING 999999                               
HDR1A999999S 1 P1190600010001 2007-08-31 2007-09-06               
HDR2F0195000130 00                                                 
UHL12007-09-069999950006EFT 2007-08-01                             
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX                   
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX                   
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX                   
EOF1A999999S 1 P1190600010001 2007-08-31                           
EOF2F0195000130                                                   
UTL1000011667309500000000000000000000000000000000000               
/*                                                                 
//SORTOUT    DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN     DD *                                                   
  SORT FIELDS=COPY                                                 
  INCLUDE COND=(1,80,SS,EQ,C'EFT',OR,                             
                1,80,SS,EQ,C'HDR',OR,           
                1,80,SS,EQ,C'UTL'),FORMAT=CH     
/*                                               
//STEP0100 EXEC PGM=FILEAID                     
//SYSPRINT DD SYSOUT=*                           
//DD01     DD DSN=&&T1,DISP=(OLD,PASS)           
//DD01O    DD SYSOUT=*                           
//SYSIN    DD *                                 
$$DD01 COPY EDITALL=(01,00,C'EFT',               
                     C'ABC')                     
/*                                               


_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Sep 07, 2007 8:17 am    Post subject: Reply with quote

haseen_mohammed,

Here is a one step file-aid which will give you the desired results.

Code:

//STEP0100 EXEC PGM=FILEAID                                   
//SYSPRINT DD SYSOUT=*                                       
//DD01     DD *                                               
VOL1P11906 INDI EFT CHARGING 999999                           
HDR1A999999S 1 P1190600010001 2007-08-31 2007-09-06           
HDR2F0195000130 00                                           
UHL12007-09-069999950006EFT 2007-08-01                       
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX               
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX               
XXXXXXXXXXXXXXDATA RECOORDSXXXXXXXXXXXXXXXXXXXX               
EOF1A999999S 1 P1190600010001 2007-08-31                     
EOF2F0195000130                                               
UTL1000011667309500000000000000000000000000000000000         
//DD01O    DD SYSOUT=*                                       
//SYSIN    DD *                                               
$$DD01 COPY IF=(1,EQ,C'VOL'),OUT=0,REPL=(01,00,C'EFT',C'FPS'),
            IF=(1,EQ,C'HDR'),OUT=0,REPL=(01,00,C'EFT',C'FPS'),
            IF=(1,EQ,C'UHL'),OUT=0,REPL=(01,00,C'EFT',C'FPS'),
            IF=(1,EQ,C'EOF'),OUT=0,REPL=(01,00,C'EFT',C'FPS'),
            IF=(1,EQ,C'UTL'),OUT=0,REPL=(4,C'0000000000000') 
/*                                                           


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Sep 07, 2007 10:36 am    Post subject: Reply with quote

Quote:
1) EFT gets changed to FPS


Does EFT always appear at the same position in the VOL1 record? If so, what is that position? Or can EFT appear anywhere in the VOL1 record?

Same question for the UHL1 record.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
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
haseen_mohammed
Beginner


Joined: 20 Feb 2006
Posts: 27
Topics: 14

PostPosted: Mon Sep 10, 2007 10:50 am    Post subject: Reply with quote

Vivek and Kolusu,

Both of them worked.

Thanks a lot for your help.

Regards,
Haseen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 10, 2007 10:56 am    Post subject: Reply with quote

haseen_mohammed,

Can you also answer frank's question?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Aug 04, 2008 12:02 pm    Post subject: Reply with quote

DFSORT now has a find and replace function. You'll need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use it. For complete details on FINDREP and all of the other new DFSORT functions, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

To change EFT to ABC anywhere in your records, you can use:

Code:

   OPTION COPY
   INREC FINDREP=(IN=C'EFT',OUT=C'ABC')


Note that you can also use FINDREP in IFTHEN clauses in the same way you would use BUILD or OVERLAY in IFTHEN clauses.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
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 -> Utilities 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