View previous topic :: View next topic
|
Author |
Message |
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
can you post an example please??, I've tried with CHANGE but doesn't works well |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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
but using OVERLAY the output would be
I have not tested this. Check this. |
|
Back to top |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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
Only one space is present between "s" and ">" and ">" will be lost when overlaid.
Nyways, Thanks for the complete JCL. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
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 |
|
|
|