Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to replace $ in a PS but only in specific places

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Dec 15, 2008 11:13 pm    Post subject: Need to replace $ in a PS but only in specific places
Reply with quote

Hi,

My Input file is delimiter seperated by $.

Sample Input file:
12345$abcd$345$
23456$adcb$456$

but also i have the below record in my input file.
23$56$a$cb$456$

The $ at 3rd position and 8th position should be replaced to ' ' but other $ which are actual delimiters should not be replaced with ' '.

Final output:

12345$abcd$345$
23456$adcb$456$
23 56$a cb$456$

Could someone help me out here?
Back to top
View user's profile Send private message

senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Dec 15, 2008 11:16 pm    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

i forgot to add one more thing. The places i mentioned (3rd and 8th position) is not fixed. It can come anywhere in the file. Can this be done in DFSORT?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 15, 2008 11:22 pm    Post subject:
Reply with quote

You say the position of the $ is not fixed, so how would you differentiate which $ character needed to be replaced and which ones to keep as is? You need to explain the rules for replacing the $ character more clearly
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Dec 15, 2008 11:29 pm    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

Hi Kolusu,

Sorry for not mentioning clearly.

The $ sign at 6th position, 11th position and 15th position (actual delimiters) should not be replaced by ' '. If $ is find at any other position, it should be replaced by ' '.
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Dec 15, 2008 11:34 pm    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

And we don't have latest JUL 2008 PTF UK90013 release in my shop (Already requested for the same)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Dec 15, 2008 11:51 pm    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

senjay,

Since you don't have the latest PTF the following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                               
12345$ABCD$345$                               
23456$ADCB$456$                               
23$56$A$CB$456$                               
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  INREC OVERLAY=(6:C'@',11:C'@',15:C'@')       
  OUTREC BUILD=(1,80,TRAN=ALTSEQ)             
  ALTSEQ CODE=(5B40)                           
  OUTFIL OVERLAY=(6:C'$',11:C'$',15:C'$')     
//*


If you have the latest PTF it can be done quite easily with FINDREP parm

Code:

//STEP0100 EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                               
12345$ABCD$345$                               
23456$ADCB$456$                               
23$56$A$CB$456$                               
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  INREC OVERLAY=(6:C'@',11:C'@',15:C'@')       
  OUTREC FINDREP=(INOUT=(C'$',C' ',C'@',C'$'))
//*


For complete details on the new FINDREP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Dec 15, 2008 11:57 pm    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

Hi Kolusu,

Thanks. But it will not work for me as i don't have the latest PTF. Could you suggest another way?
Quote:

And we don't have latest JUL 2008 PTF UK90013 release in my shop (Already requested for the same)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Dec 16, 2008 12:00 am    Post subject:
Reply with quote

senjay

*sigh* Did you really read my entire last post? I DID provide you with 2 solutions.
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Tue Dec 16, 2008 12:04 am    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

I am sorry. I am also trying here with ALTSEQ.
Somehow missed it.

I am really sorry for irritating the person who is probably having the best of patience in the forum.
:-(

I'll have a look in to your solution and get back to you. Thanks a lot.
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Tue Dec 16, 2008 1:07 am    Post subject: Reply to: Need to replace $ in a PS but only in specific pla
Reply with quote

Hi Kolusu,

Thanks a lot for your time and solution
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Route a product's job to specific lpar vasanthz All Other Mainframe Topics 9 Thu Mar 02, 2017 2:22 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us