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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Thu Jul 10, 2008 3:48 pm
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
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

Superior Member


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

PostPosted: Thu Jul 10, 2008 4:06 pm
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 Developer


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

PostPosted: Thu Jul 10, 2008 10:22 pm
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
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

Moderator Emeritus


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

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

Hello,

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

Superior Member


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

PostPosted: Mon Jul 14, 2008 4:22 pm
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: 496
Location: USA

PostPosted: Tue Jul 15, 2008 8:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Populate last day of the Month in MMD... SYNCSORT 2
Search our Forums:

Back to Top