IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to add date(MM/DD/YY) and time(HH:MM) using DFSORT?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Mon Oct 23, 2006 11:13 am
Reply with quote

Dear all icon_smile.gif ,

I have a dataset with 41 records, from which i need to select the following record and add present date & time in the below format. Please help me..

Code:
<tr><td>DATE LAST RUN ON</td><td>:</td><td>MM/DD/YY AT HH:MM</td></tr>


Thanks & Regards,
Ramanan R
Back to top
View user's profile Send private message
sridevi2005

New User


Joined: 15 Sep 2005
Posts: 42

PostPosted: Mon Oct 23, 2006 12:36 pm
Reply with quote

Hi,

Can u check this code.

SORT FIELDS=(1,15,CH,A)
OUTFIL TRAILER1=(05:'DATE LAST RUN ON : ',DATE=(MDY/),
37:'AT : ',
TIME=(24.),X,1,20),NODETAIL

Thanks,
Sridevi
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Mon Oct 23, 2006 1:42 pm
Reply with quote

Hi Sridevi,

Thanks for your response,

I got the following result with the text included 'To receive the file'. Can we eliminate this?

********************************* TOP OF DATA **********************************
DATE LAST RUN ON : 10/23/06 AT : 00.29.47 To receive the file
******************************** BOTTOM OF DATA ********************************

But i need all the data(HTML codes) in the dataset as it is.
i.e all data in the input dataset with the insertion of date & time as below.

Code:
Select the "Save Target As..",                                       
<br>                                                                 
and save the file as test.csv in your local folder.                   
<br>                                                                 
<br>                                                                 
<br> You can then go to your local folder to analyse the test.csv.   
<br>                                                                 
<br>                                                                 
<table border="0" width="100%">                                       
<tr><td>DATE LAST RUN ON</td><td>:</td><td> 10/23/06 AT 00.29 </td></tr>
<tr><td></td><td></td><td></td></tr>                                 
</table>                                                             
</body>                                                               
</html>                                                               


The required time format is HH:MM.

Thanks & Regards,
Ramanan R
Back to top
View user's profile Send private message
sridevi2005

New User


Joined: 15 Sep 2005
Posts: 42

PostPosted: Mon Oct 23, 2006 4:23 pm
Reply with quote

Hi,

Check the following code.
I did not find any Time format other than this.

//SORTREP JOB (2000),'SORT THE DATA',MSGCLASS=X,CLASS=B,
// NOTIFY=&SYSUID,REGION=4096K
//*COUNT THE NUMBER OF RECORDS USING SORT
//* ASSIGNING SEQUENCE NUMBERS BY USING SORT
//STEP01 EXEC PGM=ICEMAN
//SORTWK01 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK02 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK03 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK04 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTIN DD DISP=SHR,DSN=TA678RT.TEST.HTML
//SORTOUT DD DSN=TA678RT.TX.TEST1
// DISP=(NEW,CATLG,DELETE),
// UNIT=TARC,
// SPACE=(CYL,(30,20),RLSE),
// DCB=*.SORTIN
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL TRAILER1=(01:'<TR><TD>',09:'DATE LAST RUN ON',
26:'</TD><TD>:</TD><TD>',DATE=(MDY/),
54:'AT : ',TIME=(24:),67:'</TD></TR>'),NODETAIL

/*
//STEP02 EXEC PGM=ICEMAN
//SORTWK01 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK02 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK03 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTWK04 DD UNIT=TSRT,SPACE=(CYL,(20,20))
//SORTIN DD DISP=SHR,DSN=TA678RT.TEST.HTML
//DD2 DD DSN=TA678RT.TX.TEST2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TARC,
// SPACE=(CYL,(30,20),RLSE),
// DCB=(DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//DD4 DD DSN=TA678RT.TX.TEST3,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TARC,
// SPACE=(CYL,(30,20),RLSE),
// DCB=(DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(2,1,SS,EQ,C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),FNAMES=DD2
OUTFIL SAVE,FNAMES=DD4
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TA678RT.TX.TEST1,DISP=SHR
//SORTOUT DD DSN=TA678RT.TX.TEST4,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(20,20),RLSE),
// UNIT=(TARC,30),
// DCB=(DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(2,80)
/*
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TA678RT.TX.TEST2,DISP=SHR
// DD DSN=TA678RT.TX.TEST4,DISP=SHR
// DD DSN=TA678RT.TX.TEST3,DISP=SHR
//SORTOUT DD DSN=TA678RT.TX.TEST5,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(20,20),RLSE),
// UNIT=(TARC,30),
// DCB=(DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,80)
/*

Thanks,
Sridevi
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 24, 2006 5:07 am
Reply with quote

Ramanan R,

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=(9,9,CH,EQ,C'DATE LAST'),
      OVERLAY=(45:DATE=(MDY/),81:TIME=(24.),57:81,4))
/*
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Oct 24, 2006 11:20 am
Reply with quote

Sridevi icon_smile.gif ,

Thank you very much for your help, but it only list out the impact record with date & time.


Frank icon_smile.gif ,

Thanks for your reply, Your assumptions are correct. I tried with your code but it gives the following error message. Please advice

Code:
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 22:39 ON MON OCT
            OPTION COPY                                                       
            INREC IFOUTLEN=80,                                                 
                  $                                                           
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND                           
              IFTHEN=(WHEN=(9,9,CH,EQ,C'DATE LAST'),                           
              $                                                               
ICE005A 0 STATEMENT DEFINER ERROR                                             
                OVERLAY=(45:DATE=(MDY/),81:TIME=(24.),57:81,4))               
                $                                                             
ICE005A 0 STATEMENT DEFINER ERROR                                             
ICE012A 2 MISSING FIELDS OPERAND DEFINER                                       
ICE052I 3 END OF DFSORT                                                       


Regards,
Ramanan R
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 24, 2006 8:21 pm
Reply with quote

The messages indicate you do not have DFSORT R14 PTF UQ95213 installed. This PTF has been available since Dec, 2004 so your site is quite a bit behind on DFSORT service. Ask your System Programmer to install DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the latest DFSORT functions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top