View previous topic :: View next topic
|
Author |
Message |
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Can anyone help,
I have a file which contains some records.In this file at 21st position if I have 'AC' then I need to format the data at 55th position for all the records.How can I do this using sort and also the rest of the records have to be copied? |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
When it contains AC i want to pad 4 zeroes at 32nd position |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Unless I'm missing something here, wouldn't it be a simple:
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=VV8.RECORD.SORTEX,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=VV8.RECORD.SORTRES1,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(21,2,CH,EQ,C'AC'),
OVERLAY=(32:C'0000'))
/*
|
|
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thank you so much superk..it worked.. |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
But can u please tell me how to do the same thing using ICETOOL. Actually as far as formatting is concerned I want the 4 digits from 32 position to be moved to 36th and they should be preceeded by 4 zeroes. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's how you do the same thing with DFSORT's ICETOOL:
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=VV8.RECORD.SORTEX,DISP=SHR
//OUT DD DSN=VV8.RECORD.SORTRES1,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE)
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
OUTREC IFTHEN=(WHEN=(21,2,CH,EQ,C'AC'),
OVERLAY=(32:C'0000'))
/*
|
Quote: |
I want the 4 digits from 32 position to be moved to 36th and they should be preceeded by 4 zeroes. |
To show you how to do that, I need you to tell me the RECFM and LRECL of your input file and output file. Since you're adding 4 bytes to those records, do you want to remove the last 4 bytes from those records, or do you want to expand all of the records by 4 bytes. It would be best if you showed an example of your input records and expected output records.
You could have saved everyone time by giving the details of what you wanted in your first post. Please do that in the future. |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thanks Frank.I will try to give all the details next time in my first post only |
|
Back to top |
|
|
|