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
 

 

To SQZ only the blanks at start of the field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To SQZ only the blanks at start of the field
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 Moderator


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

PostPosted: Wed Aug 26, 2009 9:30 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Aug 27, 2009 9:03 pm    Post subject:
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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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