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

To SQZ only the blanks at start of the field


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

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Wed Aug 26, 2009 4:29 pm
Reply with quote

Hi friends,
Input:
Code:

----+----1----+----2----+----3----
  A   BBB DCCCC; FSDLJL  FJLSDJ; 
 SFKSJLJ    DFJKS;  FDKSL D;     

There 2 fields in the input file of 80 LRECL. Each field will be max of 20 bytes.
I just want to remove the blanks at the start of each field.
Output:
Code:

----+----1----+----2----+----3
A   BBB DCCCC;FSDLJL  FJLSDJ;
SFKSJLJ    DFJKS;FDKSL D;     

I have tried using SQZ=(SHIFT=LEFT), but this will squeeze out the all the blanks in the filed.
Please tell me the command by which I can restrict that happening?
I hope I made it clear

Thanks,
Balu
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Aug 26, 2009 9:30 pm
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/40)
//SORTOUT DD DSN=...  output file (FB/40)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=40,
   IFTHEN=(WHEN=INIT,
    PARSE=(%01=(ENDAT=C';',FIXLEN=25),
           %02=(FIXLEN=25)),
    BUILD=(%01,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'),
           %02,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"'))),
   IFTHEN=(WHEN=INIT,OVERLAY=(1,50,SQZ=(SHIFT=LEFT,PAIR=QUOTE))),
   IFTHEN=(WHEN=INIT,FINDREP=(IN=C'"',OUT=C''))
/*
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Aug 27, 2009 8:55 am
Reply with quote

Hi Frank,
Thanks for the code!!

I had the same idea to keep the spaces intact, But the problem I faced was to remove the additionally added quotes. Our sort version will not accept FINDREP to replace " with nothing.

Can we use ALTSEQ to do the same? If yes how?

Thanks,
Balu
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Aug 27, 2009 9:03 pm
Reply with quote

ALTSEQ can only replace characters - it can't remove them.

You need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use FINDREP. Ask your System Programmer to install it.
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top