MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SyncSort - how to save data from record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
huskynut
Beginner


Joined: 31 May 2007
Posts: 4
Topics: 3

PostPosted: Fri Mar 27, 2009 12:14 pm    Post subject: SyncSort - how to save data from record Reply with quote

I'm trying to format and output file from data on an input file. Most of the data resides on the input record I am processing however I need to store a field that resides only on certain record but needs to be on all my output records.

Anyone have ideas on how to tackle this?

Thanks!
Back to top
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Sat Mar 28, 2009 10:52 pm    Post subject: Reply with quote

Hi,

It would be good if you show some sample input records and the expected output from that. Please tell the RECFM, LRECL and the rules to get the output.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
huskynut
Beginner


Joined: 31 May 2007
Posts: 4
Topics: 3

PostPosted: Sun Mar 29, 2009 8:19 am    Post subject: Here's an example of what I am dealing with Reply with quote

I'm parsing through a report to generate delimted records for Excel. Here's what the Input is like
Code:

    PGMA  10/9/2000   COB3
    PGMB  10/10/2000
    PGMC   9/11/2000
    CPYA   2/12/2001  CPY
    CPYB   2/1/2001   
    LOADB  12/2/2003  LNK
    LOABC  12/1/2004

The 3rd column's value is present only on the first record for its respective grouping. Here's what the output needs to look like.
Code:

    PGMA  10/9/2000   COB3
    PGMB  10/10/2000  COB3
    PGMC   9/11/2000  COB3
    CPYA   2/12/2001  CPY
    CPYB   2/1/2001   CPY
    LOADB  12/2/2003  LNK
    LOABC  12/1/2004  LNK

Thanks for your help
Back to top
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Mon Mar 30, 2009 4:24 pm    Post subject: Reply with quote

huskynut:

Please try something like the following (I have assumed FB data, where the 'COB3' field starts in position 19):

Code:
//SYSIN  DD *                                           
 INREC IFTHEN=(WHEN=GROUP,                             
               BEGIN=(19,1,CH,NE,X'40'),PUSH=(19:19,4))
 SORT FIELDS=COPY                       


IFTHEN WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0 (available January 2009).
_________________
Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Mon Apr 13, 2009 4:09 am    Post subject: Reply with quote

Hi,
Try the below if you have old SYNCSORT version which supports IF then clause.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD *                                             
 PGMA  10/9/2000   COB3                                     
 PGMB  10/10/2000                                           
 PGMC   9/11/2000                                           
 CPYA   2/12/2001  CPY                                       
 CPYB   2/1/2001                                             
 LOADB  12/2/2003  LNK                                       
 LOABC  12/1/2004                                           
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T2 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//OUT      DD DSN=XXX.XXX.OUT,                   
//            DISP=(NEW,CATLG,DELETE),                       
//            UNIT=SYSDA,                                   
//            SPACE=(CYL,(100,100),RLSE),                   
//            DCB=(LRECL=80,RECFM=FB)                       
//TOOLIN   DD *                                             
  COPY FROM(IN) TO(T1) USING(CTL1)                           
  SPLICE FROM(T1) TO(T2) ON(144,8,ZD) -                     
  WITHALL WITH(1,133) KEEPBASE                               
  SORT FROM(T2) TO(OUT) USING(CTL2)                         
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(144:SEQNUM,8,ZD)),       
  IFTHEN=(WHEN=(20,4,CH,NE,C'    '),                         
  OVERLAY=(134:20,4,144:SEQNUM,8,ZD)),                       
  IFTHEN=(WHEN=NONE,                                         
  OVERLAY=(152:SEQNUM,8,ZD,                                 
  144:144,8,ZD,SUB,152,8,ZD,M11,LENGTH=8))                   
//CTL2CNTL DD *                     
  SORT FIELDS=COPY                 
  OUTREC FIELDS=(1,19,1X,134,4,80:X)


Thanks
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group