grlewycky
New User
Joined: 02 Mar 2006 Posts: 7 Location: New York City
|
|
|
|
Hi everyone,
I've looked through IBM's site and did a good share of googling for this
and I'm finding formats but nothing comparable to Oracle's date format which I need for an automated interface.
DFSORT seems to only have a numeric month and I need a literal
such as: JAN, FEB, DEC, SEP, etc. ................
The Oracle format is "dd-mmm-yy"
examples: '01-JAN-06' '20-JUL-66'
Thanks in Advance
George Lewycky
NY City Transit |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
DFSORT does not have a built-in function for that type of date, but you can easily create it as a DFSORT symbol, so you can use it wherever you want to. Here's a DFSORT step to create a symbol in the form:
MYDATE,'dd-mmm-yy'
Code: |
//DATE EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Get dd-mm-yy
INREC FIELDS=(DATE=(DMY-))
* Create DFSORT Symbol as follows:
* MYDATE,'dd-mmm-yy'
* where mmm is a literal for the month.
OUTREC FIELDS=(C'MYDATE,''',1,3,4,2,CHANGE=(3,
C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',
C'05',C'MAY',C'06',C'JUN',C'07',C'JUL',C'08',C'AUG',
C'09',C'SEP',C'10',C'OCT',C'11',C'NOV',C'12',C'DEC'),
6,3,C'''',80:X)
/*
|
Here's an example of a subsequent DFSORT step that uses MYDATE:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL HEADER1=(MYDATE)
/*
|
|
|