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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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