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
 

 

Build a dynamic query file

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

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Wed Feb 10, 2016 12:47 am    Post subject: Build a dynamic query file
Reply with quote

Hi All,

I need to build part of a dynamic query, i was able build part of it but i am not sure how to proceed further. Please help.
Thanks in advance.

Input:
Code:

02092016AB            PUERTO RICO       JOHN

The location name can come up anywhere between 11 and 41 positions.

Output Required:
Code:

'PUERTO RICO%' AND


What i tried:
Code:

//STEP010  EXEC PGM=ICETOOL                       
//IN       DD *                                     
02092016AB            PUERTO RICO       JOHN
/*                                                 
//TEMP1 DD DSN=&&TEMP1
//TEMP2   DD DSN=&&TEMP2   
//TOOLIN   DD *                               
  SORT FROM(IN)   TO(TEMP1)   USING(CTL1)
  SORT FROM(TEMP1)   TO(TEMP2)  USING(CTL2) 
/*                                           
//CTL1CNTL DD *                                             
  OPTION COPY                                               
  INREC BUILD=(11,30,JFY=(SHIFT=RIGHT))         
/*                                                           
//CTL2CNTL DD *                                             
  OPTION COPY                                               
  INREC FINDREP=(INOUT=(X'4040',X'',X'00',X''))
/*                                                           


Output I am getting:
Code:
PUERTO RICO
Back to top
View user's profile Send private message

Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Wed Feb 10, 2016 3:08 pm    Post subject:
Reply with quote

Hi,

Try using LEAD and TRAIL within JFY. I have written a piece of code with DFSORT and not ICETOOL.

SORT FIELDS=COPY
INREC BUILD=(11,30,JFY=(SHIFT=LEFT,LEAD=C'''',TRAIL=C'%'' AND'))

Hope this helps.
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 103
Location: India

PostPosted: Thu Feb 11, 2016 2:07 am    Post subject:
Reply with quote

Musab Ahmed wrote:
Hi,

Try using LEAD and TRAIL within JFY. I have written a piece of code with DFSORT and not ICETOOL.

SORT FIELDS=COPY
INREC BUILD=(11,30,JFY=(SHIFT=LEFT,LEAD=C'''',TRAIL=C'%'' AND'))

Hope this helps.


Thank you Musab! it works fine.
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 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
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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