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
 
Getting Previous line using SYNCSORT

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

New User


Joined: 25 Apr 2007
Posts: 44
Location: chennai, India

PostPosted: Mon Dec 31, 2007 4:12 pm    Post subject: Getting Previous line using SYNCSORT
Reply with quote

Hi i have a following requirement

Sample input:-

AAAA
CCCC
DDDD
AAAA
CCCC
DDDD
AAAA
EEEE
CCCC
AAAA
EEEE

Expected Output:-

AAAA
EEEE
AAAA
EEEE

i.e... For every instance of 'E' (EEEE) record. i have to get the previous record (AAAA) and 'E' (EEEE) record into the output file.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 31, 2007 6:42 pm    Post subject:
Reply with quote

Code:
//**************************
//STEP001  EXEC PGM=SYNCTOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN1      DD *             
AAAA                       
CCCC                       
DDDD                       
AAAA                       
CCCC                       
DDDD                       
AAAA                       
EEEE                       
CCCC                       
AAAA                       
EEEE                       
/*                         
//OUT      DD SYSOUT=*     
//TOOLIN   DD *             
 SELECT FROM(IN1) TO(OUT) ON(81,8,ZD) -                 
                            USING(NKK1) ALLDUPS         
/*                                                     
//NKK1CNTL DD   *                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),   
        IFTHEN=(WHEN=(1,4,CH,NE,C'EEEE'),               
          OVERLAY=(81:81,8,ZD,ADD,+1,TO=ZD,LENGTH=8))   
   OUTFIL FNAMES=OUT,BUILD=(1,80)                                 
/*                                                     
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us