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
 

 

JULIAN to MM-DD-CCYY format

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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Sat Mar 01, 2008 6:08 pm    Post subject: JULIAN to MM-DD-CCYY format
Reply with quote

I tried the following code for converting julian date to MM-DD-CCYY format.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*                               
//SORTIN DD *                                         
06012                                                 
51001                                                 
50001                                                 
07100                                                 
49001                                                 
99012                                                 
/*                                                     
//SORTOUT DD SYSOUT=*                                 
//SYSIN    DD    *                                     
  OPTION COPY                                                 
  INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),                 
    BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),                     
   IFTHEN=(WHEN=NONE,                                 
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))               
   IFTHEN=(WHEN=NONE,                             
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))                 
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)),           
   IFTHEN=(WHEN=INIT,                             
    BUILD=(5,2,C'-',7,2,C'-',1,4))               
/*                                               


But i get the abend S000 U0016.

SYSOUT content in SPOOL:
------------------------------
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message

rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Sat Mar 01, 2008 6:34 pm    Post subject:
Reply with quote

hello,

You are using SYNCSORT and this above posted JCL will work for DFSORT.

Anyways what is the version of SYNCSORT you are using at your site.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Sat Mar 01, 2008 7:06 pm    Post subject: Reply to: JULIAN to MM-DD-CCYY format
Reply with quote

Hi,

I am a fresher to mainframe.
What is difference between SYNCSORT and DFSORT?

We use the version:
SYNCSORT FOR Z/OS 1.2.2.1R (C) 2005
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Mar 01, 2008 7:46 pm    Post subject:
Reply with quote

Please post your entire sysout.....
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Sat Mar 01, 2008 8:35 pm    Post subject: Reply to: JULIAN to MM-DD-CCYY format
Reply with quote

********************************* TOP OF DATA **********************************
SYNCSORT FOR Z/OS 1.2.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSOORT INC. DATE=2008/061 TIME=10.02.23
VALLIE MAE z/OS 1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 4A74D, MODEL 2094 605 LICENNSE/PRODUCT EXPIRATION DATE: 02 JUL 2010
PARMTBLE : VSCORE=1536K,VSCORET=8M
SYSIN :
OPTION COPY
INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),
BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),
IFTHEN=(WHEN=NONE,
BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))
IFTHEN=(WHEN=NONE,
*
BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))
*
OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)),
IFTHEN=(WHEN=INIT,
BUILD=(5,2,C'-',7,2,C'-',1,4))
WER161B ALTERNATE PARM USED
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Mar 01, 2008 9:13 pm    Post subject: Re: Reply to: JULIAN to MM-DD-CCYY format
Reply with quote

karthikr44 wrote:
Code:
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCSOORT INC.   DATE=2008/061   TIME=10.02.23
                                              VALLIE MAE   z/OS   1.7.0         
 PRODUCT LICENSED FOR CPU SERIAL NUMBER 4A74D, MODEL 2094 605              LICENNSE/PRODUCT EXPIRATION DATE: 02 JUL 2010
 PARMTBLE : VSCORE=1536K,VSCORET=8M                                             
 SYSIN :                                                                       
   OPTION COPY                                                                 
   INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),                                         
     BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),                                     
    IFTHEN=(WHEN=NONE,                                                         
     BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))                                       
    IFTHEN=(WHEN=NONE,                                                         
    *                                                                           
     BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))                                       
     *                                                                         
   OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)),                                   
      IFTHEN=(WHEN=INIT,                                                       
       BUILD=(5,2,C'-',7,2,C'-',1,4))                                           
 WER161B  ALTERNATE PARM USED                                                   
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
******************************* BOTTOM OF DATA ********************************
Notice the missing comma just before the lines in error?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Mon Mar 03, 2008 10:20 am    Post subject: Reply to: JULIAN to MM-DD-CCYY format
Reply with quote

Hi,

I insert comma and again run the JCL. But it throws S0C7 abend.

Code:
//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*                               
//SORTIN DD *                                         
06012                                                 
51001                                                 
50001                                                 
07100                                                 
49001                                                 
99012                                                 
/*                                                     
//SORTOUT DD SYSOUT=*                                 
//SYSIN    DD    *                                     
  OPTION COPY                                                 
  INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),                 
    BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),                     
   IFTHEN=(WHEN=NONE,                                 
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3)),               
   IFTHEN=(WHEN=NONE,                             
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))                 
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)),           
   IFTHEN=(WHEN=INIT,                             
    BUILD=(5,2,C'-',7,2,C'-',1,4))               
/*                                 

JESYSMSG content:
Code:
----------------------
IEF237I JES2 ALLOCATED TO SORTOUT                                               
IEF237I JES2 ALLOCATED TO SYSIN                                                 
WER999A TSDSORT ,S1      ,        -  UNSUCCESSFUL SORT 0C7 S                   
IEA995I SYMPTOM DUMP OUTPUT                                                     
SYSTEM COMPLETION CODE=0C7  REASON CODE=00000000                               
 TIME=23.42.30  SEQ=42828  CPU=0000  ASID=0083                                 
 PSW AT TIME OF ERROR  078D1000   8002261C  ILC 6  INTC 07                     
   NO ACTIVE MODULE FOUND                                                       
   NAME=UNKNOWN                                                                 
   DATA AT PSW  00022616 - F871F0E2  F0EC4F00  F0E28810                         
   AR/GR 0: 80D78D58/15E1305A   1: 80D78BB4/01161F04                           
         2: 00000000/15E13000   3: 00000000/15E13050                           
         4: 00000000/15E13050   5: 00000000/40000000                           
         6: 00000000/600147C6   7: 00000000/00013550                           
         8: 00000000/0000CB68   9: 00000000/000223B4                           
         A: 00000000/00015440   B: 00000000/0002234C                           
         C: 00000000/899324C0   D: 00000000/0000E000                           
         E: 00000000/89932620   F: 00000000/800223E2                           
 END OF SYMPTOM DUMP                                                           
IEF472I TSDSORT S1 - COMPLETION CODE - SYSTEM=0C7 USER=0000 REASON=00000000     
Back to top
View user's profile Send private message
Michael Rossini

New User


Joined: 20 Feb 2008
Posts: 1
Location: NJ

PostPosted: Mon Mar 03, 2008 10:56 pm    Post subject:
Reply with quote

The problem is that you have the WHEN=NONE clause specified twice. It is converting the data from ZD to PD twice, causing the DT1 conversion to get the SOC7.

Try removing the 3rd and 4th lines of the INREC statement.

Mike Rossini
Syncsort Inc.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Tue Mar 04, 2008 1:42 am    Post subject:
Reply with quote

Hi,

Why are You specifying WHEN=NONE twice, used the below JCL (with single NONE) it went fine:
Code:
//STEP050 EXEC PGM=SORT,REGION=4096K         
//*                                           
//SYSOUT  DD  SYSOUT=*                       
//SORTIN  DD *                               
06012                                         
51001                                         
50001                                         
07100                                         
49001                                         
99012                                         
/*                                           
//SORTOUT DD SYSOUT=*                         
//SYSIN    DD    *                           
  OPTION COPY                                 
  INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),         
    BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),     
   IFTHEN=(WHEN=NONE,                         
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))     
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)), 
   IFTHEN=(WHEN=INIT,                         
    BUILD=(5,2,C'-',7,2,C'-',1,4))           
/*                                           


SORTOUT:
Code:
********************************* TOP OF DATA **********************************
01-12-2006                                                                     
01-01-1951                                                                     
01-01-1950                                                                     
04-10-2007                                                                     
01-01-2049                                                                     
01-12-1999                                                                     
******************************** BOTTOM OF DATA ********************************


HTH...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Tue Mar 04, 2008 1:46 am    Post subject:
Reply with quote

Michael Rossini wrote:
The problem is that you have the WHEN=NONE clause specified twice.


Hi Mike,

Saw Your post little late, yes above was the problem. Let TS (Thread Starter) confirm this.

P.S.:
Quote:
Mike Rossini
Syncsort Inc.
Welcome to the Forums Mike ..You were awaited here (Syncsort Inc.)... icon_smile.gif
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Mar 04, 2008 10:20 am    Post subject: Reply to: JULIAN to MM-DD-CCYY format
Reply with quote

HI,

Now the code is working .Thanks for all your help and explaining the problem in the code.

Regards
R.Karthik
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Wed Mar 05, 2008 1:06 pm    Post subject:
Reply with quote

Hi Karthik,

And thanks for keeping us posted .. icon_smile.gif
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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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