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 

Need a Sort Card to populate and Align

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


Joined: 12 Oct 2004
Posts: 13
Topics: 6

PostPosted: Sun Sep 30, 2007 9:30 pm    Post subject: Need a Sort Card to populate and Align Reply with quote

Hi,
I have a input file which is a VB file of 80 bytes. The contents of the input report file are as stated below,
Input file:
-------------------------------------------------------------
Code:

Report       -----------       
Jobname          Rep-chk1
CUSTOMER1    ------------       Report  Date:09/21/06 
CUST-NO Check-NO
0011    CK9999
0012    CK8888
0010    CK7777
Report       ----------- 
Jobname          Rep-chk2
CUSTOMER2    ------------       Report  Date:09/23/06 
CUST-NO Check-NO
0015    CK2222
0016    CK3333
0017    CK4444
Report       ----------- 
Jobname          Rep-chk3
CUSTOMER3    ------------       Report  Date:09/23/07 
CUST-NO Check-NO
9911    CK0001
9912    CK0002
9910    CK0003


The output file should as stated below,it should take the "REP-CHK*" value and the reporting date value and append it to the corresponding cust no and check no values.
Output file:
Code:

REPORT NO REP.DATE CUST-NO Check-NO
Rep-chk1  09/21/06 0011    CK9999
Rep-chk1  09/21/06 0012    CK8888
Rep-chk1  09/21/06 0010    CK7777
Rep-chk2  09/23/06 0015    CK2222
Rep-chk2  09/23/06 0016    CK3333
Rep-chk2  09/23/06 0017    CK4444
Rep-chk3  09/23/07 9911    CK0001
Rep-chk3  09/23/07 9912    CK0002
Rep-chk3  09/23/07 9910    CK0003

I need to populate using the SORT card.
Thanks
Dinesh
_________________
Thanks & Rgds
Dinesh
Back to top
View user's profile Send private message Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Oct 01, 2007 10:44 am    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (VB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T3 DD DSN=&&T3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T3,VOL=REF=*.T3,DISP=(OLD,PASS)
//    DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)
//OUT DD DSN=...  output file (VB/39)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
SPLICE FROM(T1) TO(T3) ON(5,8,ZD) VLENOVLY -
  WITH(31,8)
SPLICE FROM(CON) TO(OUT) ON(5,8,ZD) VLENOVLY -
  WITHALL WITH(40,14) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION VLSCMP
  INCLUDE COND=(5,7,CH,EQ,C'Jobname',OR,
   45,5,CH,EQ,C'Date:',OR,
   5,4,FS,EQ,NUM)
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:SEQNUM,8,ZD,21:5)),
        IFTHEN=(WHEN=(21,7,CH,EQ,C'Jobname'),
                OVERLAY=(5:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(13:SEQNUM,8,ZD,
                         5:5,8,ZD,SUB,13,8,ZD,M11,LENGTH=8))
  OUTFIL FNAMES=T1,
    INCLUDE=(21,7,CH,EQ,C'Jobname',OR,61,5,CH,EQ,C'Date:'),
    IFTHEN=(WHEN=(21,7,CH,EQ,C'Jobname'),BUILD=(1,20,21:38,8)),
    IFTHEN=(WHEN=NONE,BUILD=(1,20,31:66,8))
  OUTFIL FNAMES=T2,SAVE,
    BUILD=(1,20,40:21,14,2X)
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER2=('REPORT NO REP.DATE CUST-NO Check-NO'),
    BUILD=(1,4,5:21)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Aug 11, 2008 3:40 pm    Post subject: Reply with quote

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this much more easily and efficiently (one copy pass instead of one copy pass and two sort passes). Here's the DFSORT job using the new WHEN=GROUP function:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/80)
//SORTOUT DD DSN=...  output file (VB/39)
//SYSIN    DD    *
  OPTION COPY,VLSCMP
  INCLUDE COND=(5,7,CH,EQ,C'Jobname',OR,
   45,5,CH,EQ,C'Date:',OR,
   5,4,FS,EQ,NUM)
  INREC IFTHEN=(WHEN=(5,7,CH,EQ,C'Jobname'),
    BUILD=(1,4,5:22,8,40:C'1')),
   IFTHEN=(WHEN=(45,5,CH,EQ,C'Date:'),
    BUILD=(1,4,15:50,8,40:C'2')),
   IFTHEN=(WHEN=(5,4,FS,EQ,NUM),
    BUILD=(1,4,24:5,14,40:C'3'))
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(40,1,CH,EQ,C'1'),
    PUSH=(5:5,8)),
   IFTHEN=(WHEN=GROUP,BEGIN=(40,1,CH,EQ,C'2'),
    PUSH=(15:15,8))
 OUTFIL REMOVECC,
   HEADER2=('REPORT NO REP.DATE CUST-NO Check-NO'),
   INCLUDE=(40,1,CH,EQ,C'3'),
   BUILD=(1,39)
/*


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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