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

change a string in a VB file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 2:23 pm
Reply with quote

Input:

<tag>
<sms> hello
<more tags>
<more more>


Output:

<tag>
<smsnc> hello
<more tags>
<more more>

I need to change the string sms for the string smsnc in a VB file. It has to be a VB file at the end.

Thanks.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 2:52 pm
Reply with quote

gabriel,

Quote:
I need to change the string sms for the string smsnc in a VB file. It has to be a VB file at the end.


Check for the string in the particular column using IF and use BUILD to get the final output. As the input/output is VB take RDW (first 4 bytes) into account.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 2:56 pm
Reply with quote

can you post an example please??, I've tried with CHANGE but doesn't works well
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:05 pm
Reply with quote

gabriel,


Try this JCL. I have assumed that <sms> starts from column 1.



Code:
//SYSIN    DD *                                                         
    SORT FIELDS=COPY                                                     
    OUTREC IFTHEN=(WHEN=(6,3,CH,EQ,C'SMS'),                               
    BUILD=(1,4,5,4,C'NC',9,X))                                       
 /* 


Code X as per your requirement.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Jan 04, 2008 4:06 pm
Reply with quote

Before any one proceed with any suggestion, please let us know which SORT product yout site is using?

Look into any SORT JOB's SYSOUT for the messages, if they start with ICExxx then you use DFSORT if they start with WERxxx then you use SyncSort. This post may not be of much help, but will save a lot of efforts.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 4:14 pm
Reply with quote

Thanks to everybody, finally i did it with an ifthen and an OVERLAY:

SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(5,5,CH,EQ,C'sms '),OVERLAY=(5:C'smsnc'))

Thankyou very much for the help!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:27 pm
Reply with quote

gabriel,

Could you please post the output that you got? OVERLAY would not give the desired result. You wanted the ouitput to be as folows

Code:
<smsnc> hello


but using OVERLAY the output would be

Code:
<SMSNCHELLO


I have not tested this. Check this.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 4:37 pm
Reply with quote

The input I wrote before wasn't exactly the one I'm using:

IN:
<mensajesms >

OUT:

<mensajesmsnc >

For doing this, overlay works fine. Thanks for the help Aaru, You've given me the clue for doing the work. Thanks!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:45 pm
Reply with quote

gabriel,

Quote:
The input I wrote before wasn't exactly the one I'm using:


Oh ok. But Always make sure to let others know this.

Quote:
For doing this, overlay works fine.


Ok. But it would be great if you can post your Input,SYSIN card and the output.

Quote:
Thanks for the help Aaru, You've given me the clue for doing the work. Thanks!


You are welcome.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 4:58 pm
Reply with quote

Here comes the complete info:

Input file:
Code:
<CABECERASOPORTE>2
<MENSAJESMS   >080
<CABECERA>ENSS0020


Output file:
Code:
<CABECERASOPORTE>2
<MENSAJESMSNC >080
<CABECERA>ENSS0020


Card:
Code:
//*---------------------------------------------------
//* %%LABEL P045  PGM=SORT                           
//*---------------------------------------------------
//*                                                   
//P045    EXEC PGM=SORT,COND=(4,LT)                   
//*                                                   
//SORTIN   DD  DSN=XXX,DISP=SHR
//SORTOUT  DD  DSN=XXX,   
//             DISP=(,CATLG),UNIT=SYSDA,             
//             SPACE=(TRK,(50,10),RLSE)               
//*                                                   
//SYSOUT   DD  SYSOUT=*                               
//SYSPRINT DD  SYSOUT=*                               
//SYSIN    DD  *                                     
  SORT FIELDS=COPY                                   
  OUTREC IFTHEN=(WHEN=(5,15,CH,EQ,C'<MENSAJESMS   >'),
                       OVERLAY=(5:C'<MENSAJESMSNC >'))
/*


Thanks!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 5:14 pm
Reply with quote

gabriel,

I was not convinced with u r prev post and that is the reason for asking the JCL.

The input records in this final JCL that you have posted is very different from what you had posted before. In your previous post the input was

Quote:
IN:
<mensajesms >


Only one space is present between "s" and ">" and ">" will be lost when overlaid.

Nyways, Thanks for the complete JCL.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 5:16 pm
Reply with quote

Quote:
I was not convinced with u r prev post and that is the reason for asking the JCL.


By previous post i was refering to your post at Fri Jan 04, 2008 4:37 pm.
Back to top
View user's profile Send private message
gabriel.ryoga

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Fri Jan 04, 2008 5:42 pm
Reply with quote

I will try next time to be more accurate to the real input.

Thanks again for the help. See you on another post!
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top