IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selecting parts of a record using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Wed Nov 17, 2010 6:13 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 17, 2010 6:21 pm
Reply with quote

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 icon_evil.gif

Please remember that this is a HELP forum and not a PSYCHIC forum.
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Wed Nov 17, 2010 6:44 pm
Reply with quote

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 icon_evil.gif

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 17, 2010 7:08 pm
Reply with quote

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

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Wed Nov 17, 2010 8:01 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 17, 2010 8:07 pm
Reply with quote

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

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Wed Nov 17, 2010 9:47 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 17, 2010 10:01 pm
Reply with quote

Hello,

Depending on what you want to accomplish, you might use BUILD or OVERLAY.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Nov 18, 2010 7:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top