View previous topic :: View next topic
|
Author |
Message |
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
vvmanyam
New User
Joined: 16 Apr 2008 Posts: 86 Location: Bangalore
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|