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

Generating Quotes in BUILD statement output.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Oct 27, 2009 10:40 pm
Reply with quote

Hi,

Could you please suggest a solution.
I have a DFSORT step that generates a DFSORT control statements for subsequent DFSORT step.
The below step reads the date followed by record type '0'.(only 1 type '0' record is found)
Subtracts 100 from it and puts it in the sort card output.

Eg: Input file:

Code:
0200908


Output file:

Code:
    INCLUDE COND=((1,1,ZD,EQ,2,AND,23,6,ZD,GE,200807),
         OR,1,1,ZD,EQ,0,OR,1,1,ZD,EQ,9)



DFSORT job:

Code:
//S1       EXEC  PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN1      DD DSN=XW62.SDG76S01,DISP=SHR                         
//TEMP1    DD DSN=&&TEMP1,UNIT=TEMP,SPACE=(TRK,(1,1),RLSE),     
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),DISP=(NEW,PASS)     
//TOOLIN   DD *                                                 
 COPY FROM(IN1) TO(TEMP1) USING(CTL1)                           
/*                                                               
//CTL1CNTL DD *                                                 
  INCLUDE COND=(1,1,CH,EQ,C'0')                                 
  INREC IFOUTLEN=80,IFTHEN=(WHEN=(1,1,CH,EQ,C'0'),               
  BUILD=(5:C'INCLUDE COND=((1,1,ZD,EQ,2,AND,23,6,ZD,GE,',       
                          2,6,ZD,SUB,+100,M11,LENGTH=6,C'),'))   
  OUTFIL REMOVECC,                                               
  TRAILER1=(C'         OR,1,1,ZD,EQ,0,OR,1,1,ZD,EQ,9)')         
/*                                                               


When we try to generate
Code:

    INCLUDE COND=((1,1,CH,EQ,C'2',AND,23,6,ZD,GE,200807),
         OR,1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'9')


I get an error with misplaced quotes.
Could you please let me know how we can use multiple quotes inside a build statement.

P.S. - I am unable to use REXX since the file is huge. Ty for ur patience in reading this long post icon_biggrin.gif .

Thanks in advance,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 27, 2009 11:29 pm
Reply with quote

vasanthz,

Use the following DFSORT/ICETOOL JCl

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD DSN=XW62.SDG76S01,DISP=SHR
//TEMP1    DD DSN=&&TEMP1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//TOOLIN   DD *                                               
  COPY FROM(IN1) USING(CTL1)                                 
//CTL1CNTL DD *                                               
  INCLUDE COND=(1,1,CH,EQ,C'0')                               
  OUTFIL FNAMES=TEMP1,                                       
  BUILD=(3:C'INCLUDE COND=((',                               
           C'1,1,ZD,EQ,2,AND,23,6,ZD,GE,',                   
           2,6,ZD,SUB,+100,M11,LENGTH=6,C'),OR,'/,           
        18:C'1,1,ZD,EQ,0,OR,1,1,ZD,EQ,9)',80:X)               
//*
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Oct 28, 2009 12:11 am
Reply with quote

Hi Kolusu,

Thanks for your time in replying.
I might not have been clear with the requirement, I need to generate

Code:
    INCLUDE COND=((1,1,CH,EQ,C'2',AND,23,6,ZD,GE,200807),
         OR,1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'9')



In the segment
Quote:
CH,EQ,C'2'.

When we try to specify this ' between C & 2 I get the error.


I will try to capture that error tomorrow when im at workplace.

Thanks & Regards,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Oct 28, 2009 12:29 am
Reply with quote

vasanthz,

change your CTL1CNTL to the following

Code:

//CTL1CNTL DD *                                         
  INCLUDE COND=(1,1,CH,EQ,C'0')                         
  OUTFIL FNAMES=TEMP1,                                   
  BUILD=(3:C'INCLUDE COND=((',                           
           C'1,1,CH,EQ,C''',C'2''',C',AND,23,6,ZD,GE,', 
           2,6,ZD,SUB,+100,M11,LENGTH=6,C'),OR,'/,       
        18:C'1,1,CH,EQ,C''',C'0''',                     
           C',OR,1,1,CH,EQ,C''',C'9''',C')',80:X)       
//*                                                     


This will generate

Code:

  INCLUDE COND=((1,1,CH,EQ,C'2',AND,23,6,ZD,GE,200808),OR,
                 1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'9')         
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Oct 28, 2009 1:03 am
Reply with quote

Thanks again,

I try this and let you know.

Regards,
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Help in extracting data between doubl... DFSORT/ICETOOL 5
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
Search our Forums:

Back to Top