IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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
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:

Use [URL] BBCode for External Links
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts To replace jobname in a file with ano... SYNCSORT 12
This topic is locked: you cannot edit posts or make replies. Construct new record using specific f... DFSORT/ICETOOL 6
Search our Forums:

Back to Top