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
 

 

Sort file using SYNCSORT

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

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Wed Aug 11, 2010 11:34 am    Post subject: Sort file using SYNCSORT
Reply with quote

Hi All
I have below requirement
Can anybody help me in this regards

I have to copy data from input file position 5 length 15
to output file position 9 length 15 and
moves 0000 to output file position 5 length 4
and copy data from 24 position in input file unchanged
to output file

Note :- Header and trailer should be copy
as they are in input file and can be recognized
by first character 'H' or 'T'

Thanks
Bhairon
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 11, 2010 11:39 am    Post subject:
Reply with quote

Please post SYNCSORT questions in the JCL forum.
Topic moved.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Wed Aug 11, 2010 12:13 pm    Post subject:
Reply with quote

Your requirement is not so clear. What about output position 1-4? And you said
Quote:
copy data from 24 position in input file unchanged
from 24 till which position? Your topic title says 'SORT', but you do mention only about 'COPY'. Are you trying to sort the records enclosed by 'H' and 'T' records?
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Wed Aug 11, 2010 12:26 pm    Post subject:
Reply with quote

Hi Arun
Clarification for above question
1) Spaces in 1-4 Position
2) 24 till 400 Position remains unchanged
3) Need to copy, If possible data can be sorted too.

Regards
Bhairon
Back to top
View user's profile Send private message
mfsundar

New User


Joined: 05 Apr 2009
Posts: 7
Location: India

PostPosted: Wed Aug 11, 2010 3:07 pm    Post subject:
Reply with quote

Try this
Code:

SORT FIELDS=COPY                                       
OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),BUILD=(1,400)),     
       IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),BUILD=(1,400)),     
       IFTHEN=(WHEN=NONE,BUILD=(1:4X,5:C'0000',9:5,15,24:24,400))
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Wed Aug 11, 2010 3:26 pm    Post subject:
Reply with quote

Thanks I got the Desired Output
Back to top
View user's profile Send private message
bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Wed Aug 11, 2010 3:55 pm    Post subject:
Reply with quote

Just need to change last IFTHEN=(WHEN=NONE,BUILD=(1:4X,5:C'0000',9:5,15,24:24,400)) to IFTHEN=(WHEN=NONE,BUILD=(1:4X,5:C'0000',9:5,15,24:24,377))
Back to top
View user's profile Send private message
mfsundar

New User


Joined: 05 Apr 2009
Posts: 7
Location: India

PostPosted: Wed Aug 11, 2010 6:41 pm    Post subject:
Reply with quote

You are welcome.
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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us