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 

Modifing the PS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Thu Jun 19, 2003 4:26 pm    Post subject: Modifing the PS Reply with quote

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
View user's profile Send private message
dorkhead
Beginner


Joined: 07 Jan 2003
Posts: 25
Topics: 0
Location: Lux

PostPosted: Fri Jun 20, 2003 8:05 am    Post subject: Reply with quote

utility suggestion would be DFSORT's icetool (it provides some date handling features)

or REXX ?
_________________
Dorkhead
Back to top
View user's profile Send private message Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jun 20, 2003 9:06 am    Post subject: Reply with quote

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
View user's profile Send private message
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Fri Jun 20, 2003 10:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jun 20, 2003 10:46 am    Post subject: Reply with quote

Subra,
I am sorry but, you would ICETOOL here. Embarassed


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
View user's profile Send private message
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Fri Jun 20, 2003 12:24 pm    Post subject: Reply with quote

Cogito-Ergo-Sum,

Thanks for the code . I really helped me.

Thanks once again,

Cheers,
Subra
Back to top
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Fri Jun 20, 2003 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Sun Jun 22, 2003 10:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
A.Benveniste
Beginner


Joined: 23 Jun 2003
Posts: 4
Topics: 0

PostPosted: Mon Jun 23, 2003 8:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon Jun 23, 2003 8:24 am    Post subject: Reply with quote

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
View user's profile Send private message
hsubra
Beginner


Joined: 18 Jun 2003
Posts: 25
Topics: 11

PostPosted: Mon Jun 23, 2003 3:07 pm    Post subject: Reply with quote

Alain,

Thanks. It worked for me .

Cheers,
Subra
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 -> Job Control Language(JCL) 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