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

SYNCSORT - Record starting condition & end condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 496
Location: USA

PostPosted: Wed Aug 18, 2010 11:30 pm
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
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 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