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
 

 

SYNCSORT - Record starting condition & end condition

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

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Wed Aug 18, 2010 4:19 pm    Post subject: SYNCSORT - Record starting condition & end condition
Reply with quote

Hi All,

I have the input file as below:

RECFM=FB, LRECL=80

AAAA
BBBB
CCCC
DDDD
EEEE
FFFF
GGGG
HHHH


Output file should be
CCCC
DDDD
EEEE
FFFF

The condition here is: the copy should start when (01,02,CH,EQ,C'CC')
and it should end when (01,02,CH,EQ,C'FF')
I am not sure if we can use these condition inside SKIPREC OR STOPAFT.


However, if anyone knows a simpler way, please let me know.


-Thanks,
Rakesh.
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Aug 18, 2010 11:30 pm    Post subject:
Reply with quote

Hello Rakesh.

Here is a SyncSort for z/OS 1.3.2 job that will produce the requested output:
Code:
//STEP1 EXEC PGM=SORT
//SORTIN  DD *       
AAAA                 
BBBB                 
CCCC                 
DDDD                 
EEEE                 
FFFF                 
GGGG                 
HHHH                 
//SORTOUT DD SYSOUT=*
//SYSOUT  DD SYSOUT=*
//SYSIN   DD *                                   
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'CC'),
   END=(1,2,CH,EQ,C'FF'),PUSH=(81:ID=1))         
 SORT FIELDS=COPY                                 
 OUTFIL INCLUDE=(81,1,ZD,EQ,1),BUILD=(1,80)       
/*
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Thu Aug 19, 2010 8:10 pm    Post subject: Reply to: SYNCSORT - Record starting condition & end con
Reply with quote

Thank You Alissa!!! It worked.


I modified the sortcard to my exact requirement... my end condition was also getting satisfied exactly at the first row... so it was copying just one row.

I changed the end condition, and it worked.
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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am


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