Append a particular position of bytes from two files



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Append a particular position of bytes from two files

Postby viki » Mon Dec 03, 2012 7:43 pm

Hi All,

Good evening.My requirement is to append a particular position of bytes from two files to be copied into third file.

Example:
File 1 lrecl: 80=> Out of that i want to copy extract from postion 10 to 50
File 2 lrecl: 10=> out of that i wan to extract from position 5 to 10

Output file:

File 3:lrecl 45=>10 to 50 bytes recs of file1 + 5 to 10 bytes of file2.

Please help me out.

Thanks,
viki.
viki
 
Posts: 10
Joined: Mon May 02, 2011 8:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Append a particular position of bytes from two files

 

Re: Append a particular position of bytes from two files

Postby enrico-sorichetti » Mon Dec 03, 2012 8:05 pm

what happened when You searched the DFSORT and/or the SYNCSORT sections with JOINKEYs ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Append a particular position of bytes from two files

Postby dick scherrer » Mon Dec 03, 2012 8:36 pm

Hello,

Which sort product is being used?

Do these files have a common key that can be used to JOIN?

Is there a guarantee there will be the same number of records in both files?

You need to post some sample data from both input files and the ouptut you want from this sample input - use the Code tag.

Your lengths are not as you say. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Append a particular position of bytes from two files

Postby BillyBoyo » Mon Dec 03, 2012 9:32 pm

Looks like SyncSort from an earlier post. It is a simple JOINKEYS, if you have something to JOIN on, as Dick has already noted, so we await your response to his questions.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Append a particular position of bytes from two files

Postby viki » Fri Dec 14, 2012 8:57 pm

Hi All,

sorry for the too delayed response.Actually i was trying with Join keys.But i didn't find the right way.

Actually my requirement is to change a set of position with some values.

Example:

File 1: AAAA.BBBB.CCCC-> contains 5 records

Name city Address State
1-----5 6----10 11----15 16-----20
ABCDE GDGDK 12ABC GFHDH
GGHGA DFDS 78SFF HSHFSF
FSFEE EFWEF EWABC SGSGER
YTYTY AAAAA BBBBB CCCCC
KKKKK LLLLL MMMMM FFFFF

I want to replace all the data in a position 6-10 and 16-20

Original Record(6-10) Needs to be changed in the position(6-10)
GDGDK AGFAF
DFDS DSFSF
EFWEF FFETE
AAAAA FSGWE
LLLLL WFGWE

same thing needs to be done for 16-20 position also.

Note: No values are unique.

Please share your ideas if you any.

Once again thanks to everyone who provided suggestion on this.I will be happy if i got anything.

Thanks,
viki.
viki
 
Posts: 10
Joined: Mon May 02, 2011 8:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Append a particular position of bytes from two files

Postby viki » Fri Dec 14, 2012 9:02 pm

The final output should be like this.

Name city Address State
1-----5 6----10 11----15 16-----20
ABCDE AGFAF 12ABC AAAAA
GGHGA DSFSF 78SFF BBBBB
FSFEE FFETE EWABC VVVVV
YTYTY FSGWE BBBBB KKKKK
KKKKK WFGWE MMMMM ZZZZZ

Thanks,
viki.
viki
 
Posts: 10
Joined: Mon May 02, 2011 8:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Append a particular position of bytes from two files

Postby enrico-sorichetti » Fri Dec 14, 2012 9:07 pm

if You are looking for <SORT> solution good manners dictate that You post to the appropriate forum
( YES, there is a forum for SYNCSORT and one for DFSORT )

find out what <SORT> product You are using DFSORT(ICE.... messages)/SYNCSORT(WER.... messages)
and post the result of

//S1 EXEC PGM=ICEMAN(SORT/SYNCSORT/whatever)
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY
/*


so that we know the level of Your sort and the functions avilable
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Append a particular position of bytes from two files

Postby viki » Fri Dec 14, 2012 10:02 pm

i tried with SORT and SYNCSORT.I was getting WER message.

Thanks,
viki
viki
 
Posts: 10
Joined: Mon May 02, 2011 8:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Append a particular position of bytes from two files

Postby dick scherrer » Fri Dec 14, 2012 11:43 pm

Hello,

You need to post the jcl and sort control statements you used along with the complete output with the diagnostic and informational messages.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Append a particular position of bytes from two files

Postby NicC » Sat Dec 15, 2012 4:49 am

I have moved you to the Syncsort forum.
When you post the information requested by Dick please use the code tags. Th data you posted earlier is a load of ... as you did not use the code tags. Look at Enrico's post - he used the code tags. See how much easier it is to read his post than yours?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post