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 

Add Current year using DFSort / icetool

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


Joined: 19 Apr 2006
Posts: 7
Topics: 4

PostPosted: Wed Apr 19, 2006 1:19 am    Post subject: Add Current year using DFSort / icetool Reply with quote

HI,

My input file looks like this :

Code:
1DATE/TIME OF THIS RUN: 060417 09.05         
04/16 15.32.26 29                    PROCESSED A3-STEP END
04/16 15.32.26 29                    PROCESSED A3-STEP END
04/16 15.32.26 29                    PROCESSED A3-STEP END
04/16 15.32.26 29                    PROCESSED A3-STEP END


I want an output file which looks like this : (only using jcl through DFSort / Icetool)

Code:
1DATE/TIME OF THIS RUN: 060417 09.05         
04/16/06 15.32.26 29                    PROCESSED A3-STEP END
04/16/06 15.32.26 29                    PROCESSED A3-STEP END
04/16/06 15.32.26 29                    PROCESSED A3-STEP END
04/16/06 15.32.26 29                    PROCESSED A3-STEP END



Is there any straight way ?

Thanks,
Chirag
Back to top
View user's profile Send private message
hariavinash
Beginner


Joined: 21 Jan 2005
Posts: 52
Topics: 7

PostPosted: Wed Apr 19, 2006 4:35 am    Post subject: Reply with quote

Chirag2901,

Hope this JCL will help you.

cheers
Code:

//USERID JOB 00000000,'ICETOOL',CLASS=L,NOTIFY=&SYSUID
//**
//SORT1    EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DISP=OLD,DSN=INPUT.DATASET
//OUT      DD DISP=SHR,DSN=OUTPUT.DATASET
//TOOLIN   DD *
  COPY FROM(IN) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,5,C'06',06,50)
/*
//**
Back to top
View user's profile Send private message
chirag2901
Beginner


Joined: 19 Apr 2006
Posts: 7
Topics: 4

PostPosted: Wed Apr 19, 2006 4:57 am    Post subject: Reply with quote

hi Avinash,

tx. for the reply.

I need to take the year from the first record of the input file.

e.g. the first record is :
1DATE/TIME OF THIS RUN: 060417 09.05

So, I need to extract "06" from this first record and then append it to all the remaining records.

I cannot hard code them.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Wed Apr 19, 2006 7:56 am    Post subject: Reply with quote

chirag2901,

The following JCL will give you the desired results. I assumed that your input is 80 bytes in length and the year portion (YY) starts at pos 25 on the first record.

Code:

//STEP0100 EXEC  PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//HDR      DD DSN=YOUR OUTPUT FILE,                             
//            DISP=(NEW,CATLG,DELETE),                     
//            UNIT=SYSDA,                                   
//            SPACE=(CYL,(1,1),RLSE)                       
//SYM      DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)   
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  OPTION STOPAFT=1                                           
  OUTFIL FNAMES=HDR                                         
  OUTFIL FNAMES=SYM,                                         
  OUTREC=(C'YR,C',                                           
          C'''',                                             
          C'/',                                             
          25,2,                                             
          C'''',                                             
          80:X)                                             
/*     
//STEP0200 EXEC PGM=SORT                   
//SYMNAMES DD DSN=&T1,DISP=OLD             
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD DSN=SAME OUTPUT FILE AS STEP0100 OUTPUT,
//            DISP=(MOD,CATLG,DELETE),
//            UNIT=PROD,                               
//            SPACE=(CYL,(60,20),RLSE)                   
//SYSIN    DD *                                       
  SORT FIELDS=COPY,SKIPREC=1                           
  OUTREC FIELDS=(01,05,                               
                 YR,                                   
                 06,72)                               
/*                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
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: Wed Apr 19, 2006 11:02 am    Post subject: Reply with quote

Here's another way to do it with DFSORT:

Code:

//S1 EXEC  PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD *
  OPTION COPY,STOPAFT=1
  OUTREC BUILD=(C'YR,C''/',25,2,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file
//SORTOUT  DD DSN=...  output file
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,5,CH,NE,C'1DATE'),
    BUILD=(1,5,YR,6,72))
/*

_________________
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