Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Selecting parts of a record using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Selecting parts of a record using SYNCSORT
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:

http://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: 8614
Location: Back in jolly old England

PostPosted: Wed Nov 17, 2010 6:21 pm    Post subject:
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    Post subject:
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: 8614
Location: Back in jolly old England

PostPosted: Wed Nov 17, 2010 7:08 pm    Post subject:
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    Post subject:
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: 8614
Location: Back in jolly old England

PostPosted: Wed Nov 17, 2010 8:07 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Nov 17, 2010 10:01 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Nov 18, 2010 7:09 pm    Post subject:
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    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 query to fetch record which has only ... maxsubrat DB2 2 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us