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
 
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 query to fetch record which has only ... maxsubrat DB2 12 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