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
 

 

change a string in a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: change a string in a VB file
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 2:52 pm    Post subject: Reply to: change a string in a VB file
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:05 pm    Post subject: Reply to: change a string in a VB file
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

Senior Member


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

PostPosted: Fri Jan 04, 2008 4:06 pm    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:27 pm    Post subject: Reply to: change a string in a VB file
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 4:45 pm    Post subject: Reply to: change a string in a VB file
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 5:14 pm    Post subject: Reply to: change a string in a VB file
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: 1288
Location: Chennai, India

PostPosted: Fri Jan 04, 2008 5:16 pm    Post subject: Reply to: change a string in a VB file
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    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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