check char value in OUTFIL



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

check char value in OUTFIL

Postby richagoyal » Tue Sep 28, 2010 4:49 pm

hi ,
i am facing a problem in OUTFIL, i am trying to put a query in the output dataset from jcl in the string. i am able to create the dataset with required query but i want to check SF_SUB_ACCT_TYPE = L and it is a char field ,but not able to check .

 //SORT009  EXEC PGM=SORT                         
//SYSOUT   DD  SYSOUT=*                           
//SORTIN   DD  DSN=CS.DH6D.DATE.B2.BATQ110,DISP=SH
//SORTOUT  DD  DSN=CS.DH6D.DEL.CURDSF,           
//             DISP=(,CATLG,DELETE),             
//             DCB=(RECFM=FB,LRECL=100),         
//             SPACE=(100,(1,1),RLSE),AVGREC=K   
//SYSIN    DD  *                                 
 SORT FIELDS=COPY                                 
 OUTFIL BUILD=(C'SELECT * FROM DSF_SUB_FACILITY ',
               C'WHERE SF_YEAR_MTH = ',           
               52:53,6,                           
               C' AND SF_SUB_ACCT_TYPE =',C'L',   
               C'; COMMIT; ',                     
               09C' ')                           

how can i check for char value while building the string through outfil ?
richagoyal
 
Posts: 20
Joined: Thu May 27, 2010 11:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: check char value in OUTFIL

 

Re: check char value in OUTFIL

Postby richagoyal » Tue Sep 28, 2010 5:05 pm

Expected output :

SELECT * FROM DSF_SUB_FACILITY WHERE SF_YEAR_MTH = 200910 AND SF_SUB_ACCT_TYPE ='L'; COMMIT;

output coming with above query :
SELECT * FROM DSF_SUB_FACILITY WHERE SF_YEAR_MTH = 200910 AND SF_SUB_ACCT_TYPE = L; COMMIT;

when i submit this query its failing as SF_SUB_ACCT_TYPE is char field .
richagoyal
 
Posts: 20
Joined: Thu May 27, 2010 11:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: check char value in OUTFIL

Postby NicC » Tue Sep 28, 2010 8:24 pm

Probably have to double quote (i.e. use 2 single quotes) the L. Check the documentation for quoted strings.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: check char value in OUTFIL

Postby Frank Yaeger » Wed Sep 29, 2010 2:40 am

richagoyal,

Use this DFSORT OUTFIL statement:

  SORT FIELDS=COPY                                           
  OUTFIL BUILD=(C'SELECT * FROM DSF_SUB_FACILITY ',         
               C'WHERE SF_YEAR_MTH = ',                     
               52:53,6,                                     
               C' AND SF_SUB_ACCT_TYPE =',C'''L''',         
               C'; COMMIT; ',                               
               100:X)                                       
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: check char value in OUTFIL

Postby richagoyal » Wed Sep 29, 2010 2:35 pm

Thanks Frank , its working !
richagoyal
 
Posts: 20
Joined: Thu May 27, 2010 11:45 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post