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
 

 

SQZ=(SHIFT=LEFT) with IFTHEN

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

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue Jul 09, 2013 12:32 am    Post subject: SQZ=(SHIFT=LEFT) with IFTHEN
Reply with quote

Hi all,

I have a input record to be squeezed but if there is any spaces as the only value in the field - I would like to retain only one space.

could any of you please help how we could achive this

Input record
Code:

"AA  ","BBBBB    ","CCC'CCCC      ","DDD D","    "


My current sort cord
Code:

OPTION COPY                       
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))


My current output
Code:

"AA","BBBBB","CCC'CCCC","DDDD",""


Whereas my expected output is

Code:

"AA","BBBBB","CCC'CCCC","DDDD"," "


Please note the space in the last field.

Thank you very much!
Back to top
View user's profile Send private message

karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Tue Jul 09, 2013 12:43 am    Post subject: Reply to: SQZ=(SHIFT=LEFT) with IFTHEN
Reply with quote

Kind of arrived at the solutions icon_smile.gif

But is there any other intresting solution - I would like to know !

Code:
OPTION COPY                             
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))     
OUTREC FINDREP=(IN=C',""',OUT=C'," "') 
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jul 09, 2013 12:54 am    Post subject: Re: Reply to: SQZ=(SHIFT=LEFT) with IFTHEN
Reply with quote

I hink you're about there. You don't need both INREC and OUTREC. I assume you want the embedded blank to disappear from "DDD D"? The inclusion of the "," in your test isn't strictly needed (you shouldn't have another way to get "" together) and it would mean your code would not work if the first "column" of your CSV were "blank".

Code:
OPTION COPY                             
INREC IFTHEN=(WHEN=INIT,BUILD=(1,80,SQZ=(SHIFT=LEFT))),     
      IFTHEN=(WHEN=INIT,FINDREP=(IN=C'""',OUT=C'" "')) 
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 Coverting PD to FS and also left just... Atul Banke DFSORT/ICETOOL 6 Wed Aug 24, 2016 4:31 pm
No new posts technology shift from Mainfame to AS400 Prayag P V All Other Mainframe Topics 3 Tue Jul 19, 2016 12:13 pm
No new posts Overlay with right shift Bill Woodger DFSORT/ICETOOL 3 Thu Jan 28, 2016 7:49 pm
This topic is locked: you cannot edit posts or make replies. BBC is seeking a Security Operations ... Express Mainframe Jobs 0 Tue Dec 22, 2015 1:20 am
No new posts Zero suppress and shift left Bryant Shearin DFSORT/ICETOOL 10 Sat Oct 31, 2015 9:28 pm


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