Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort How to take system date in sort jcl - MMDDYY format

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
himantgoyal
Warnings : 1

New User


Joined: 14 Aug 2006
Posts: 8

PostPosted: Thu Jul 10, 2008 1:15 pm    Post subject: Syncsort How to take system date in sort jcl - MMDDYY format
Reply with quote

Hi ,

Could anyone please help me , How I can retrieve system date in Sort JCl in MMDDYY format

My control card is

SORT FIELDS=COPY
OUTREC FIELDS(1,44,date)

1-44 is data from input file.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 10, 2008 3:48 pm    Post subject:
Reply with quote

Hi,

Try this

Code:
//SYSIN   DD    *         
  OPTION COPY             
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(DATE=(MD4-))
/*
Back to top
View user's profile Send private message
himantgoyal
Warnings : 1

New User


Joined: 14 Aug 2006
Posts: 8

PostPosted: Thu Jul 10, 2008 4:01 pm    Post subject: Reply to: How to take system date in sort jcl in MMDDYY form
Reply with quote

Using above ,date is coming in 07-10-2008 format . I want in 071008 (MMDDYY) format
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 10, 2008 4:06 pm    Post subject:
Reply with quote

Hi,

Ok, before I go ahead with some other suggestion, one more thing to know, why did you show
Quote:
OUTREC FIELDS(1,44,date)

in your example ? I didn't get it.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Jul 10, 2008 10:22 pm    Post subject:
Reply with quote

himantgoyal,

DATENS=(MDY) in TRAILER1 will give you an 'mmddyy' date.

But if you want the 'mmddyy' date to replace date in your OUTREC statement, you can use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
TDATE,S'&DAY.&MON.&YR2'
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=COPY
  OUTREC BUILD=(1,44,TDATE)
/*
Back to top
View user's profile Send private message
Vasukip
Currently Banned

New User


Joined: 17 Jun 2008
Posts: 48
Location: Chennai

PostPosted: Fri Jul 11, 2008 4:10 pm    Post subject:
Reply with quote

Frank,

I tried this control Statement - SYMNAMES with String I'm getting user abend.
fyi,
Code:

SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS:
                                          * P
PRODUCT LICENSED FOR CPU SERIAL NUMBER AC56E,
*** ERRORS IN SYMNAMES STATEMENTS ***       
TDATE,S'&DAY.&MON.&YR2'                     
      *                                     
*** SYNTAX ERROR ***                         
WER470A  SYMNAMES ERRORS FOUND               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 11, 2008 8:45 pm    Post subject:
Reply with quote

Hello,

You system is running Syncsort rather than DFSORT.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jul 14, 2008 4:22 pm    Post subject:
Reply with quote

Hi,
Vasukip wrote:
I tried this control Statement - SYMNAMES with String I'm getting user abend.

Support for SYMNAMES is available in 1.3 onwards releases of SyncSort, You are using little earlier version (from the SYSOUT you posted in earlier post)
Code:
SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS:
so the error was there.

Again, do you want the 'mmddyy' date to replace date in your OUTREC statement ? or would this suffice
Code:
//SYSIN   DD    *             
  OPTION COPY                 
  OUTFIL REMOVECC,NODETAIL,   
    TRAILER1=(DATENS=(MDY))   
/*                           
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Jul 15, 2008 8:36 pm    Post subject:
Reply with quote

Here are 2 possible solutions:
Code:
//STEP1 EXEC PGM=SORT
//SORTIN  DD DSN=input.file
//SORTOUT DD DSN=output.file
//SYSOUT  DD SYSOUT=*
//SYSIN   DD *                                     
  SORT FIELDS=COPY                               
  OUTREC IFTHEN=(WHEN=(INIT),
      BUILD=(1,44,&DATE)),
    IFTHEN=(WHEN=(47,1,CH,EQ,C'/'),           
      BUILD=(1,44,45,2,48,2,51,2))                 
/* 

Code:
//STEP1 EXEC PGM=SORT
//SORTIN  DD DSN=input.file
//SORTOUT DD DSN=output.file
//SYSOUT  DD SYSOUT=*
//SYSIN   DD *                                     
   INREC FIELDS=(1,44,&DATE)         
   SORT FIELDS=COPY                 
   OUTREC FIELDS=(1,44,45,2,48,2,51,2)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us