MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
hsubra Beginner Joined: 18 Jun 2003 Posts: 25 Topics: 11
Posted: Thu Jun 19, 2003 4:26 pm Post subject: Modifing the PS
I have a huge PS file. I want to change a date 00/00/00 to current date . Is there any utility in the JCL. ( : We do not have FILEAID with us) .
Please suggest some JCL utilities and if poosible code !
Thanks ,
Subra
Example
file:
ABCD NEWYORK 00/00/00
EFGH BOSTON 11/11/03
1234 CHENNAI
BDEF BLR 12/12/03
AAAA CHENNAI 00/00/00
Expected output:
ABCD NEWYORK 06/19/03
EFGH BOSTON 11/11/03
1234 CHENNAI
BDEF BLR 12/12/03
AAAA CHENNAI 06/19/03
Back to top
dorkhead Beginner Joined: 07 Jan 2003 Posts: 25 Topics: 0 Location: Lux
Posted: Fri Jun 20, 2003 8:05 am Post subject:
utility suggestion would be DFSORT's icetool (it provides some date handling features)
or REXX ? _________________ Dorkhead
Back to top
Cogito-Ergo-Sum Advanced Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Fri Jun 20, 2003 9:06 am Post subject:
hsubra ,
Of course, SORT is one way of doing it. (ICETOOL is not really needed here.) But, it seems, the date field that you are showing is not appearing at the same column always. Is this really the case ? Or, is it just appearing so ? If the date field appears constantly at a certain position then, it is easy.
Please elaborate. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes .
Back to top
hsubra Beginner Joined: 18 Jun 2003 Posts: 25 Topics: 11
Posted: Fri Jun 20, 2003 10:03 am Post subject:
Hi,
The date positon is same column always It is on column 25 - 32 . Excuse for Rexx. Can you give me some hints on this !!
Cheers,
Subra
Back to top
Cogito-Ergo-Sum Advanced Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Fri Jun 20, 2003 10:46 am Post subject:
Subra,
I am sorry but, you would ICETOOL here.
Code:
//STEP EXEC PGM=ICETOOL
//TOOLIN DD *
COPY FROM(IN01) USING(CPY1)
COPY FROM(T1) TO(T3) USING(CPY2)
SORT FROM(CON) TO(OT01) USING(SRT1)
/*
//IN01 DD *
RECORD 1 00/00/00
RECORD 2 06/20/03
RECORD 3 06/25/03
RECORD 4 06/04/03
RECORD 5 00/00/00
/*
//T1 DD DSN=&&TEMP0001,
// DISP=(,PASS)
//T2 DD DSN=&&TEMP0002,
// DISP=(,PASS)
//T3 DD DSN=&&TEMP0003,
// DISP=(,PASS)
//CON DD DSN=&&TEMP0002,
// DISP=(SHR,PASS),
// VOL=REF=*.T2
// DD DSN=&&TEMP0003,
// DISP=(SHR,PASS),
// VOL=REF=*.T3
//OT01 DD SYSOUT=*
//CPY1CNTL DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
OUTFIL FNAMES=T1,
INCLUDE=(25,8,CH,EQ,C'00/00/00')
OUTFIL FNAMES=T2,
SAVE
/*
//CPY2CNTL DD *
INREC FIELDS=(1,24,DATE1(/),80:X,81,8)
OUTREC FIELDS=(1,24,30,3,33,2,C'/',27,2,80:X,81,8)
/*
//SRT1CNTL DD *
SORT FIELDS=(81,8,ZD,A)
OUTREC FIELDS=(1,80)
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
The first pass splits the input file into 2 depending on the dates. The second pass puts in the actual date (in mm/dd/yy format. DATE1 results date in yyyymmdd format.) The third pass reformats the output. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes .
Back to top
hsubra Beginner Joined: 18 Jun 2003 Posts: 25 Topics: 11
Posted: Fri Jun 20, 2003 12:24 pm Post subject:
Cogito-Ergo-Sum ,
Thanks for the code . I really helped me.
Thanks once again,
Cheers,
Subra
Back to top
CaptBill Beginner Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
Posted: Fri Jun 20, 2003 3:22 pm Post subject:
There are lots of other tools you could use. VISION:Results, EasyTrieve are just two that come to mind. Do you have either of those available?
VISION:Results solution:
Code:
OPTION PRINTERROR
FILE INFILE
DATE_IN_ERROR 8 25 CH
FILE OUTFILE OUTPUT FROM INFILE
IF DATE_IN_ERROR EQ '00/00/00'
MOVE DYLDATE to DATE_IN_ERROR
ENDIF
Back to top
Cogito-Ergo-Sum Advanced Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Sun Jun 22, 2003 10:49 pm Post subject:
hsubra ,
You are welcome. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes .
Back to top
A.Benveniste Beginner Joined: 23 Jun 2003 Posts: 4 Topics: 0
Posted: Mon Jun 23, 2003 8:14 am Post subject:
Cogito,
For your info, you can create the sysin dynamically : so you can do it in one pass and half.
Code:
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(ICE0)
COPY FROM(IN2) USING(ICE1)
/*
//IN1 DD *
/*
//IN2 DD *
12/31/01
00/00/00
01/20/98
00/00/00
10/14/02
00/00/00
/*
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
INREC FIELDS=(DATE1)
OUTFIL FNAMES=ICE1CNTL,
OUTREC=(1:C' OUTFIL FNAMES=OUTX,',80:X,/,
1:C' OUTREC=(1,8,CHANGE=(8,C''00/00/00'',',
44:C'C''',46:5,2,48:C'/',49:7,2,51:C'/',52:3,2,C'''),',
57:C'NOMATCH=(1,8))',80:X)
/*
//ICE1CNTL DD DSN=&T,UNIT=SYSDA,SPACE=(80,(1,80)),DISP=(,DELETE)
OUTX gives :
Code:
12/31/01
06/23/03
01/20/98
06/23/03
10/14/02
06/23/03
Respectful, from a dfsorter to a dfsorter
Alain
Back to top
Cogito-Ergo-Sum Advanced Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Mon Jun 23, 2003 8:24 am Post subject:
Alain ,
I got it. Replace all 00/00/00 by a date that is in a c'card generated dynamically.
Hsubra,
You have now 'two' ways to fulfil your requirements. Take your pick ! _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes .
Back to top
hsubra Beginner Joined: 18 Jun 2003 Posts: 25 Topics: 11
Posted: Mon Jun 23, 2003 3:07 pm Post subject:
Alain,
Thanks. It worked for me .
Cheers,
Subra
Back to top
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