View previous topic :: View next topic
|
Author |
Message |
mohd Waseem Ahmed
New User
Joined: 30 May 2008 Posts: 9 Location: hyderabad
|
|
|
|
Can you please let me know the JCL step which will take the input as below and output will have the same records and a duplicate of that particular record which has the value as 004454211 in the first 15 bytes.
That is whenever first 15 bytes are ‘004454211 ‘ then this should be replaced with ‘037518412D72 ‘, but the old record should also be present in the file.
I/p PS file:
004454211 81002008041020080410QYQY009331497
004454211 810101 000000005D000000005DEA00000
output should be like below when first 15 bytes in the record are '004454211 '
004454211 81002008041020080410QYQY009331497
004454211 810101 000000005D000000005DEA00000
037518412D72 81002008041020080410QYQY009331497
037518412D72 810101 000000005D000000005DEA00000 |
|
Back to top |
|
|
mohd Waseem Ahmed
New User
Joined: 30 May 2008 Posts: 9 Location: hyderabad
|
|
|
|
Can you please let me know the JCL step which will take the input as below and output will have the first 15 bytes changed to '037518412D72 ' .
That is whenever first 15 bytes are ‘004454211 ‘ then this should be changed to ‘037518412D72 ‘.
I/P PS file:
004454211 81002008041020080410QYQY009331497
004454211 810101 000000005D000000005DEA00000
Output file:
037518412D72 81002008041020080410QYQY009331497
037518412D72 810101 000000005D000000005DEA00000 |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
make up your mind,,, do You want to duplicate or only change...
how do You expect an answer if You keep changing Your questions
when posting data use the code tag to preserve the blnks and record layout
here is a snippet ( not tested ) that might give You an hint on how to proceed
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,15,CH,EQ,C'123456789012345'),
OVERLAY=(1:C'123456789012345'))
/* |
|
|
Back to top |
|
|
mohd Waseem Ahmed
New User
Joined: 30 May 2008 Posts: 9 Location: hyderabad
|
|
|
|
I am extreamly sorry, but i need this to be done urgently, thats y what i did was that i have copied all the records with first 15 bytes as <004454211 > into a new file, So my present requirement will be to change the all the records with first 15 bytes to a new value, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
but i need this to be done urgently |
for urgencies never rely on forums
replying is on voluntary basis, time availability and at no charge
and the posting style must make people willing to answer,
posting repeatedly, changing mind, claiming urgency,
well... are just things that do not encourage
if You want something done quickly, according to Your specs and out of the box
You/Your_organization should be prepared to pay for it |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Can you edit the file in ISPF and pass command Change |
|
Back to top |
|
|
mohd Waseem Ahmed
New User
Joined: 30 May 2008 Posts: 9 Location: hyderabad
|
|
|
|
Can somebody please help me on this, only if they have time i take my words back that it is urgent... I shudnt be using that |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
try the snippet I posted, it should work |
|
Back to top |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
You can achieve this through the below jcl. I have used SORT in three steps to do this but this can be simplified i believe.
Code: |
//SSORT EXEC PGM=SORT
//SORTIN DD DSN=USERID.SORTIN,DISP=SHR
//SORTOUT DD DSN=USERID.SORTTEMP,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
//*
/*
//SSORT1 EXEC PGM=SORT
//SORTIN DD DSN=USERID.SORTTEMP,DISP=SHR
//SORTOUT DD DSN=USERID.SORTTEMP,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(1,10,CH,EQ,C'004454211 '),
BUILD=(C'037518412D72 ',11,67))
//*
/*
//SSORT2 EXEC PGM=SORT
//SORTIN DD DSN=USERID.SORTIN,DISP=SHR
// DD DSN=USERID.SORTTEMP,DISP=SHR
//SORTOUT DD DSN=USERID.SORTOUT,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,80,CH,A)
SUM FIELDS=NONE
//* |
|
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
and make a save before |
|
Back to top |
|
|
Varun Singh
New User
Joined: 01 Aug 2007 Posts: 25 Location: Delhi
|
|
|
|
//S0000001 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
004454211 81002008041020080410QYQY009331497
004454211 810101000000005D000000005DEA00000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,15,CH,EQ,C'004454211 '),
OVERLAY=(1:C'037518412D72 '))
/*
output comes as :-
037518412D72 81002008041020080410QYQY009331497
037518412D72 810101000000005D000000005DEA00000
try the above JCL I had tried it works.... |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Please clarify also this
"004454211" does not make a length of 15.
Is it more "replace with shift" than just "replace" ?
If it is urgent, give us all the information and clear information.
Again can you Edit the file? |
|
Back to top |
|
|
Varun Singh
New User
Joined: 01 Aug 2007 Posts: 25 Location: Delhi
|
|
|
|
Yes !! PeD you are correct!!,
I had assumed and taken
(004454211 with blanks ) = 15 bytes
and had replaced
(037518412D72 with blanks) = 15 bytes
Everytime posting an issue should clarify things at one shot
which will help and enthusize others for quick and accurate reply |
|
Back to top |
|
|
Varun Singh
New User
Joined: 01 Aug 2007 Posts: 25 Location: Delhi
|
|
|
|
//S0000001 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
004454211 81002008041020080410QYQY009331497
004454211 810101000000005D000000005DEA00000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,15,CH,EQ,C'004454211 '),
OVERLAY=(1:C'037518412D72 '))
/*
output comes as :-
037518412D72 81002008041020080410QYQY009331497
037518412D72 810101000000005D000000005DEA00000 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
mohd,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
004454211 81002008041020080410QYQY009331497
004454211 810101 000000005D000000005DEA00000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,15,CH,EQ,C'004454211'),
OVERLAY=(1:C'037518412D72',3X))
/*
|
For the WHEN operand, the constant will be padded on the right with blanks to the length of the field (15 characters). For the OVERLAY operand, we use 3X to pad the constant with blanks on the right to 15 characters. |
|
Back to top |
|
|
mohd Waseem Ahmed
New User
Joined: 30 May 2008 Posts: 9 Location: hyderabad
|
|
|
|
Hi PED,Varun and enrico-sorichetti thanks a lot for your help, I am sorry i did not post the correct file, but |
|
Back to top |
|
|
|