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
 

 

Including Single Quotes in Output File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Tue May 17, 2011 6:43 pm    Post subject: Including Single Quotes in Output File
Reply with quote

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
Code:
C'''


Hence, Please advice the correct method.


Thanks.
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Tue May 17, 2011 7:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue May 17, 2011 11:16 pm    Post subject:
Reply with quote

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
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Wed May 18, 2011 11:27 am    Post subject:
Reply with quote

Thanks Vasanthz and Frank.

Help was much appreciated 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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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