View previous topic :: View next topic
|
Author |
Message |
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
Hello,
I have written below sort card :
Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=(14,10,CH,EQ,C'CURRENT_DATE - 1 DAYS'),
OVERLAY=(1:C''',2:DATE1(-)-1,12:C'''))
|
All I am trying to do is, in my output file I want a single quote at position 1, then (CURRENT_DATE-1 DAYS) at position 2-11, single quote again at position 12.
Output file will look like this:
Code: |
'2011-05-16'
'2011-05-16'
'2011-05-16'
'2011-05-16'
|
I know the sort card written by me does not work as we cannot give a single quote like
Hence, Please advice the correct method.
Thanks. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
For FB LRECL = 80, You could use,
Code: |
OUTREC BUILD=(1:C'''',2:DATE1(-)-1,12:C'''',13:77X) |
Hope it helps. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Aslam,
There are several ways to code a single apostrophe in a DFSORT string.
One way, as shown by vasznth is to use two apostrophes for each single apostrophe -> C'''' for one apostrophe.
Another way, which some people find easier, is to use X'7D':
Code: |
BUILD=(X'7D',...,X'7D',...)
|
A third way is to set up and use a Symbol:
Code: |
//SYMNAMES DD *
Apost,X'7D'
...
//SYSIN DD *
...
BUILD=(Apost,...,Apost,...)
|
|
|
Back to top |
|
|
techslam
New User
Joined: 03 Dec 2010 Posts: 87 Location: India
|
|
|
|
Thanks Vasanthz and Frank.
Help was much appreciated |
|
Back to top |
|
|
|