View previous topic :: View next topic
Author
Message
shitij New User Joined: 09 Sep 2005Posts: 31 Location: Delhi
Hi,
I have a VB file with 404 lenght (while browsing its 400), now I want to shift the code '0002' present at 339 position of the file to 23rd position.
I was using SYNCSORT - OUTREC, but the jobs abending....the job I was trying was:
//SORT01 EXEC PGM=SYNCSORT
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=DATASET.INPUT,DISP=SHR
//SORTOUT DD DSN=DATASET.OUTPUT,
// SPACE=(404,(1000,200),RLSE),
// DCB=(RECFM=VB,LRECL=404,DSORG=PS,BLKSIZE=0),
// DISP=(,CATLG,DELETE),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,22,23:339,4,27:27,374)
/*
//*
I know the above job would not go in case of VB - Please could someone tell me the correct job - which I should try.
Would be really obliged, thanks.
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Do you intend to make the output four bytes longer?
Which?
Code:
from
xxxxxxxyyyyyyyzzzzzzz0002aaaaaa
to
xxxxxxxyyy0002yyyyzzzzzzzaaaaaa
or
xxxxxxxyyy0002zzzzzzz0002aaaaaa
or
xxxxxxxyyy0002yyyyzzzzzzz0002aaaaaa
Back to top
shitij New User Joined: 09 Sep 2005Posts: 31 Location: Delhi
Thanks for replying, no would want to keep the same lengh i.e. -
from
xxxxxxxyyyyyyyzzzzzzz0002aaaaaa
to
xxxxxxxyyy0002yyyyzzzzzzzaaaaaa
So no increase in lenght.
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
Try with the below sort card, if you want to overwrite the 23,4(position and length in browse mode) with 339,4(position and length in browse mode)
Code:
SYSIN DD *
OPTION COPY
INREC OVERLAY=(27:343,4)
Back to top
murmohk1 Senior Member Joined: 29 Jun 2006Posts: 1436 Location: Bangalore,India
Shankar,
Quote:
SYSIN DD *
OPTION COPY
INREC OVERLAY=(27:343,4)
Your control card just copies the data from 339 pos to 20 position, leaving the data @ 339 as it is. But the req is to copy the data as well as shifting the data.
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
using the shortened example:
Code:
1234567890123456789012345678901234567890
llbbxxxxxxxyyyyyyyzzzzzzz0002aaaaaa
1234567890123456789012345678901234567890
llbbxxxxxxxyyy0002yyyyzzzzzzzaaaaaa
I think this would work:
1:1,14,15:26,4,19:15,11,30:30,6
you need to account for the three parts of the data, the removal of the 0002, the insertion of the 0002 and the shift of the data between the insertion and removal....
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
murmohk1,
Thanks for notifying me.
shitij,
Try with the below sort card for your requirement.
Code:
//SYSIN DD *
OPTION COPY
INREC FIELDS=(001:001,004,
005:005,022,
027:343,004,
031:027,317,
348:348,057)
Back to top
shitij New User Joined: 09 Sep 2005Posts: 31 Location: Delhi
Hi ,
the above one is not working, please could someone give an example of what I am looking for.
Please, thanks.
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Please post the "not working" output.....
Back to top
shitij New User Joined: 09 Sep 2005Posts: 31 Location: Delhi
The one I am now using is :
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(27:343,4,343:C' ')
/*
//*
The thing is that the HDR and TRL shud be not undergo this overlay, may I know how can we do that?
HDR : 1797912007053120070907130258ALPS10705 EXTRACT FILE
Details Records :
501
501
501 i.e all detail records start with 501.
TRL : 9..Ï....ç.æ....<....hï......hï..
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
You'll need to add some IFTHEN logic.......
Back to top
prakash271082 New User Joined: 09 Sep 2005Posts: 53
Hi,
I think Shakar's code,
//SYSIN DD *
OPTION COPY
INREC FIELDS=(001:001,004,
005:005,022,
027:343,004,
031:027,317,
348:348,057)
should be working with one change in last line of control card. It should be,
343: 348,057 instead of 348:348,057.
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
shitij,
field1=001,022(position and length in browse mode)
field2=023,317(position and length in browse mode)
field3=339,004(position and length in browse mode)
field4=343,057(position and length in browse mode)
If you want to change [field1,field2,field3 ,field4] to [field1,field3 ,field2,field4] for all detail records which starts with '501', use the following sort card.
Code:
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'501'),
BUILD=(001:001,004,
005:005,022,
027:343,004,
031:027,317,
348:348,057))
If you want to override 23,4(position and length in browse mode) with 339,4(position and length in browse mode) for all detail records which starts with '501', use the following sort card
Code:
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'501'),OVERLAY=(27:343,4))
prakash271082,
Hi,
Quote:
I think Shakar's code,
//SYSIN DD *
OPTION COPY
INREC FIELDS=(001:001,004,
005:005,022,
027:343,004,
031:027,317,
348:348,057)
should be working with one change in last line of control card. It should be,
343: 348,057 instead of 348:348,057.
I think it will work correct. Please let me know if i am wrong.
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
shitij,
Please use
Code:
INREC IFTHEN=(WHEN=(5,3,CH,EQ,C'501'),
instead of
Code:
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'501'),
in the before posted one for both two codes as it is a VB file.
Back to top
Please enable JavaScript!