IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Trying to add current date in place of DATE


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

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Wed Aug 12, 2020 4:14 pm
Reply with quote

Hello,

I am trying to replace YYYYMMDD with today's date in data using SORT but when I use quotes simply 'DATE' is being written. Can someone help me to fix it.
Code:

ICE805I 1 JOBNAME: CPFPH06A , STEPNAME: STEP0010
 ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
 ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R3  - 10:29 ON WED AU
             SORT FIELDS=COPY
             OUTREC FIELDS=(1,1,80)
              OUTFIL FILES=01,OMIT=(1,1,SS,EQ,C'.'),FTOV,
              IFTHEN=(WHEN=(1,80,SS,EQ,C'YYYYMMDD'),
              FINDREP=(IN=C'YYYYMMDD',OUT=DATE1))
                                          £
ICE007A 1 SYNTAX ERROR
              OUTFIL FILES=02,INCLUDE=(1,1,SS,EQ,C'.'),FTOV
 ICE751I 0 C5-BASE   C6-BASE   C7-BASE   C8-BASE   E7-I49502
 ICE052I 3 END OF DFSORT

Read more: http://ibmmainframes.com/viewtopic.php?p=350103#350103#ixzz6UtqSSz5a
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 875
Location: Maryland

PostPosted: Wed Aug 12, 2020 5:56 pm
Reply with quote

Please read carefully the ONLY allowed formats for FINDREP parameters values:

Quote:
Permissible syntax expressions for input and output constants are listed below.

• C’string’
• nC’string’
• X’string’
• nX’string’
• C” This expression can only be used to define a null output constant.

. . .

OUT=oc
Specifies the output constant that will be used to replace any of the
input constants that are found. oc represents the output constant
used in the replace operation. See description above on how to specify
output constants.



I hope this answers your question: "Why syntax error"?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1097
Location: Dublin, Ireland

PostPosted: Wed Aug 12, 2020 5:58 pm
Reply with quote

Hi Shub,

I got the desired result taking a slightly different approach:

I added:
Code:

//SYMNAMES DD *         
TODAY,S'&YR4.&MON.&DAY' 


to pick up system symbols in SYMNAMES and then

Code:
   FINDREP=(IN=C'YYYYMMDD',OUT=TODAY))


Hope this helps.

Garry
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 350
Location: Bamberg, Germany

PostPosted: Wed Aug 12, 2020 6:32 pm
Reply with quote

Code:
//DATE1    EXEC PGM=ICEMAN,PARM='MSG=NO'                             
//SORTIN   DD *                                                     
DUMMY                                                               
/*                                                                   
//SORTOUT  DD DISP=(NEW,PASS),UNIT=SYSALLDA,SPACE=(80,(1,1)),AVGREC=U
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC BUILD=(C'Date1,C''',DATE1,C'''',63X)                         
  END                                                               
/*                                                                   
//JUSTDOIT EXEC PGM=ICEMAN,PARM='MSG=NO'                             
//SYMNAMES DD DISP=(OLD,PASS),DSN=*.DATE1.SORTOUT                   
//SORTIN   DD *                                                     
.                                                                   
             YYYYMMDD                                               
/*                                                                   
//SORTOUT  DD SYSOUT=*                                               
//SORTOF01 DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  OMIT COND=(1,1,CH,EQ,C'.')                                         
  SORT FIELDS=COPY                                                   
  OUTFIL FILES=01,                                                   
    FTOV,                                                           
    IFTHEN=(WHEN=(1,80,SS,EQ,C'YYYYMMDD'),                           
      FINDREP=(IN=C'YYYYMMDD',OUT=Date1))                           
  END                                                               
/*
Back to top
View user's profile Send private message
shub2204

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Wed Aug 12, 2020 6:41 pm
Reply with quote

Check my step ..still getting syntax error
Code:

//STEP0010 EXEC PGM=SORT
//SORTIN DD DATA,DLM=##
HELO OS39026
MAIL FROM:<RMG-POH7@ROYALMAIL.COM>
RCPT TO:<SHUBHAM.CHAUHAN@CAPGEMINI.COM>
DATA
TO:  ADDRESS.MANAGEMENT@ROYALMAIL.COM
CC:  SHUBHAM.CHAUHAN@CAPGEMINI.COM
SUBJECT:  AFD DAILY CHANGES ZIP FILE FOR YYYYMMDD
IMPORTANCE: HIGH
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="_frontier"

--_frontier
CONTENT-TYPE: TEXT/HTML

<!DOCTYPE HTML>
<HTML>
<head>
<style>
 th {background-color: lightblue;}
 h1 {
     text-align: center;
 }
table {
  width:100%;
}
table, th, td {
  border: 1px solid black;
  border-collapse: collapse;
}
th, td {
  padding: 2px;
  text-align: left;
}
</style>
</head>
<BODY>
<P STYLE="FONT-FAMILY:CALIBRI;color:black">
Hi All,
</p>
<P STYLE="FONT-FAMILY:CALIBRI;color:black">
Please find attached the zipped daily changes file for AFD .<br>
<br>
</P>
<P STYLE="FONT-FAMILY:CALIBRI;color:black">
Thanks,<br>
Capgemini Mainframe Team<br>
<br>
This email was produced by batch job CPFPV220.  Do not reply to this
email.
</p>
</BODY>
</HTML>

--_frontier
CONTENT-TYPE: APPLICATION/OCTET-STREAM
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=AFD.ZIP
CONTENT-TRANSFER-ENCODING: BASE64

.
##
//SORTOF01 DD SYSOUT=*
//*SORTOF01 DD DSN=&&HEADER,DISP=(NEW,PASS),
//*          DCB=(LRECL=27994,RECFM=V,BLKSIZE=27998),
//*          SPACE=(CYL,(1,2)),UNIT=SYSDA
//SORTOF02 DD DSN=&&TRAILER,DISP=(NEW,PASS),
//          DCB=(LRECL=27994,RECFM=V,BLKSIZE=27998),
//          SPACE=(CYL,(1,2)),UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//SYSNAMES DD *TODAY,S'&YR4.&MON.&DAY'
//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,1,80)
  OUTFIL FILES=01,OMIT=(1,1,SS,EQ,C'.'),FTOV,
  IFTHEN=(WHEN=(1,80,SS,EQ,C'YYYYMMDD'),
  FINDREP=(IN=C'YYYYMMDD',OUT=TODAY))
  OUTFIL FILES=02,INCLUDE=(1,1,SS,EQ,C'.'),FTOV
//
//*---------------------------------------------------------------------



ERROR MESSAGE

********************************* TOP OF DATA **********************************
ICE805I 1 JOBNAME: CPFPH06A , STEPNAME: STEP0010
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5650-ZOS, Z/OS DFSORT V2R3  - 14:10 ON WED AU
            SORT FIELDS=COPY
            OUTREC FIELDS=(1,1,80)
            OUTFIL FILES=01,OMIT=(1,1,SS,EQ,C'.'),FTOV,
            IFTHEN=(WHEN=(1,80,SS,EQ,C'YYYYMMDD'),
            FINDREP=(IN=C'YYYYMMDD',OUT=TODAY))
                                        £
ICE007A 1 SYNTAX ERROR
            OUTFIL FILES=02,INCLUDE=(1,1,SS,EQ,C'.'),FTOV
ICE751I 0 C5-BASE   C6-BASE   C7-BASE   C8-BASE   E7-I49502
ICE052I 3 END OF DFSORT
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1097
Location: Dublin, Ireland

PostPosted: Wed Aug 12, 2020 6:47 pm
Reply with quote

That's not the way to specify SYMNAMEs . The JCL line & the data lione are separate.

Garry
Back to top
View user's profile Send private message
shub2204

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Wed Aug 12, 2020 6:51 pm
Reply with quote

I have added correctly in next line..it is a typo in cut copy paste
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 350
Location: Bamberg, Germany

PostPosted: Wed Aug 12, 2020 7:06 pm
Reply with quote

Code:
//SYSNAMES ..


name it SYMNAMES and it will work.
Back to top
View user's profile Send private message
shub2204

New User


Joined: 13 May 2020
Posts: 19
Location: India

PostPosted: Wed Aug 12, 2020 7:18 pm
Reply with quote

Thanks a many many lot Joerg and Gary .. i changed to SYMNAMES..

Actually ..Thanks all .it worked icon_smile.gif

You guys rock
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Date format conversion DFSORT/ICETOOL 4
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
No new posts current batch plan DB2 3
No new posts Required Date Format in Include Sort ... DFSORT/ICETOOL 6
No new posts Populating Date and Sequence numer in... SYNCSORT 11

Back to Top