View previous topic :: View next topic
|
Author |
Message |
fredrick andrews
New User
Joined: 10 Jun 2010 Posts: 52 Location: chennai
|
|
|
|
Hi,
My requirement is to select a particular part( By position of course) of every record from a dataset and copy them in another dataset.
Please find the Sample I/p and O/p in the image:
img301.imageshack.us/img301/8809/picyni.jpg
Thanks in advance! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
From your previous post it seems that you have SYNCSORT and not DFSORT.
Please post in the JCL forum for SYNCSORT.
Well, with so much useful information that you have given, errrrrr not, can we just guess what the selection criteria is or perhaps you could tell us the rules
Please remember that this is a HELP forum and not a PSYCHIC forum. |
|
Back to top |
|
|
fredrick andrews
New User
Joined: 10 Jun 2010 Posts: 52 Location: chennai
|
|
|
|
expat wrote: |
From your previous post it seems that you have SYNCSORT and not DFSORT.
Please post in the JCL forum for SYNCSORT.
Well, with so much useful information that you have given, errrrrr not, can we just guess what the selection criteria is or perhaps you could tell us the rules
Please remember that this is a HELP forum and not a PSYCHIC forum. |
Hi, Thanks for the reply...
I was editing the post as the I/p and O/p file didn't look like they were supposed to...
BTW, the selection criteria of the records are :
5th position, lenght - 6
17th position, length - 8
36th position, lenght - 1
59th position, length - 12
Thanks for understanding! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well I for one can not open your link so can do absolutely nothing to help you.
Post the data, using the code tags,
Code: |
[code] your stuff
goes in
here[/code] |
and also the rules for getting from input to output |
|
Back to top |
|
|
fredrick andrews
New User
Joined: 10 Jun 2010 Posts: 52 Location: chennai
|
|
|
|
expat wrote: |
Well I for one can not open your link so can do absolutely nothing to help you.
Post the data, using the code tags,
Code: |
[code] your stuff
goes in
here[/code] |
and also the rules for getting from input to output |
Input file :
Code: |
TALA311057POL10201458THALADA0SIRI
TALA311057POL10201458THALADA0SIRI
TALA315024POL10201812THALADA0SIRI
TALA380050POL10201830THALADA0SIRI
TALA314231POL10201758THALADA0SIRI
|
Output file:
Code: |
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI
|
Selection criteria:
1st position, lenght - 4 -> TALA
11th position, length - 3 -> POL
22th position, lenght - 7 -> THALADA
30th position, length - 4 -> SIRI |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
So basically you are wanting to select certain areas from the record, and fill in the rest with blanks ?
What have YOU tried so far and what problems have you encountered. |
|
Back to top |
|
|
fredrick andrews
New User
Joined: 10 Jun 2010 Posts: 52 Location: chennai
|
|
|
|
expat wrote: |
So basically you are wanting to select certain areas from the record, and fill in the rest with blanks ?
What have YOU tried so far and what problems have you encountered. |
I tried this:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(17,8,36,1,45,6,82,6)
// |
I could get the o/p , but without the spaces ....
I could manage with this for my current requirement..
However, I would like to know how we can add some constant values between the selected fields in OUTREC FIELDS..
Thanks for all the help! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Depending on what you want to accomplish, you might use BUILD or OVERLAY. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Only If I understood what are you asking, try this:
Code: |
//COUNT EXEC PGM=SORT
//SORTIN DD *
TALA311057POL10201458THALADA0SIRI
TALA311057POL10201458THALADA0SIRI
TALA315024POL10201812THALADA0SIRI
TALA380050POL10201830THALADA0SIRI
TALA314231POL10201758THALADA0SIRI
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:1,4,11:11,3,22:22,7,30:30,4)
/*
//* |
Output will be:
Code: |
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI
TALA POL THALADA SIRI |
|
|
Back to top |
|
|
|