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
 

 

Shift 4 digit code from 339th position of VB file to 23rd.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Sep 11, 2007 2:38 pm    Post subject: Shift 4 digit code from 339th position of VB file to 23rd.
Reply with quote

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
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 2:53 pm    Post subject:
Reply with quote

Do you intend to make the output four bytes longer?
Which?
Code:
from
xxxxxxxyyyyyyyzzzzzzz0002aaaaaa
to
xxxxxxxyyy0002yyyyzzzzzzzaaaaaa
or
xxxxxxxyyy0002zzzzzzz0002aaaaaa
or
xxxxxxxyyy0002yyyyzzzzzzz0002aaaaaa
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Sep 11, 2007 2:58 pm    Post subject: Reply to: Shift 4 digit code from 339th position of VB file
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue Sep 11, 2007 3:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Tue Sep 11, 2007 3:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 3:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Tue Sep 11, 2007 3:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Sep 11, 2007 7:33 pm    Post subject: Reply to: Shift 4 digit code from 339th position of VB file
Reply with quote

Hi ,

the above one is not working, please could someone give an example of what I am looking for.


Please, thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Sep 11, 2007 7:35 pm    Post subject:
Reply with quote

Please post the "not working" output.....
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Sep 11, 2007 9:15 pm    Post subject: Reply to: Shift 4 digit code from 339th position of VB file
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 9:20 pm    Post subject:
Reply with quote

You'll need to add some IFTHEN logic.......
Back to top
View user's profile Send private message
prakash271082

New User


Joined: 09 Sep 2005
Posts: 53

PostPosted: Wed Sep 12, 2007 11:19 am    Post subject:
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Sep 12, 2007 12:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Sep 12, 2007 12:56 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM 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 3 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