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
 

 

Using single SORT condition need to Pickup the next record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Wed Jul 23, 2008 8:17 pm    Post subject: Using single SORT condition need to Pickup the next record
Reply with quote

Hi,

I am having the requirement to extract the data from the report .so i am using sort to extract the records that the field EVENT HAVING '1'
I can able to extract the first line of the record only i need the USER NAME(USER ID) field also it is in the second line ,please let me know how to extract the USER NAME Field using sort




*JOB/USER *STEP/
DATE TIME SYSID NAME GROUP EVENT

08.022 09:54:23 SP07 USERIDV XXUSERSX 1
USER ID AAAA

08.033 09:22:20 SP06 USERIDJ XXXUSERV 1
USER ID BBBB[img][/img]
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 23, 2008 9:00 pm    Post subject:
Reply with quote

what did you use to extract the 'event having' ?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jul 23, 2008 10:45 pm    Post subject:
Reply with quote

priya,

It's not clear what you want to do. You show two records that end with '1' each followed by a USER ID record. If that's what the report really looks like, then you could just use INCLUDE to include each record with '1' and each record with 'USER ID'. If it's more complicated than that, for example some records don't have a '1' so you don't want those records or the USER ID records that follow them, then you need to show a better example of your input records with all variations and your expected output. Explain the "rules" for getting from input to output. Also, give the RECFM and LRECL of the input file and the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 24, 2008 3:08 am    Post subject:
Reply with quote

Spriya,

if your intention is to get the next record which follows the '1' then here is DFSORT/ICETOOL JCL which will give you the desired results

Code:

//STEP0100  EXEC  PGM=ICETOOL   
//TOOLMSG   DD SYSOUT=*         
//DFSMSG    DD SYSOUT=*         
//IN        DD DSN=your input file,Disp=shr
//OUT       DD SYSOUT=*                                     
//TOOLIN    DD *                                             
  SELECT FROM(IN) TO(OUT) ON(134,8,CH) ALLDUPS USING(CTL1)
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=INIT,                                 
       OVERLAY=(134:SEQNUM,8,ZD)),                         
        IFTHEN=(WHEN=(26,1,CH,EQ,C'1'),             
       OVERLAY=(134:+1,ADD,134,8,ZD,M11,LENGTH=8))         
                                                           
  OUTFIL FNAMES=OUT,BUILD=(01,133)
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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