Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Removing starting spaces in lines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 10:29 am    Post subject: Removing starting spaces in lines
Reply with quote

I want to remove starting spaces of a line

Code:


        abcdsba
       bsakbkd
    backjsbcka


and want output like


Code:

abcdsba
bsakbkd
backjsbcka



Record length of file is 80 and number of spaces are not fixed means i have to remove spaces untill character is encountered.

I cant use ICEMAN or ICETOOL utility

could u suggest some ways for this
Back to top
View user's profile Send private message
References
PostPosted: Tue May 13, 2008 10:29 am    Post subject: Re: Removing starting spaces in lines Reply with quote

krisprems

Senior Member


Joined: 27 Nov 2006
Posts: 627
Location: India

PostPosted: Tue May 13, 2008 10:55 am    Post subject:
Reply with quote

scorp_rahul23, Can you use SORT?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 10:59 am    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

Ya we can use SORT
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 457

PostPosted: Tue May 13, 2008 11:11 am    Post subject:
Reply with quote

Hi,
in REXX you can use the SPACE function.


Gerry
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 11:22 am    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

I have to use only SORT or COBOL. not in rexx
Back to top
View user's profile Send private message
krisprems

Senior Member


Joined: 27 Nov 2006
Posts: 627
Location: India

PostPosted: Tue May 13, 2008 11:23 am    Post subject:
Reply with quote

scorp_rahul23,
Let me tell you one thing ICEMAN is ALIAS of SORT. SORT and ICEMAN can be used inter changeably.
ICETOOL is an extention of DFSORT.

For your problem you can use the SQZ function of ICEMAN/SORT
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 11:53 am    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

Code:

SORT FIELDS=COPY                     
OUTREC FIELDS=(1,255,SQZ=(SHIFT=LEFT))


i m getting this error

Code:

 SORT FIELDS=COPY                           
 OUTREC FIELDS=(1,255,SQZ=(SHIFT=LEFT))     
                      *                     
WER268A  OUTREC STATEMENT  : SYNTAX ERROR   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE



can u tell me what to do
Back to top
View user's profile Send private message
krisprems

Senior Member


Joined: 27 Nov 2006
Posts: 627
Location: India

PostPosted: Tue May 13, 2008 12:07 pm    Post subject:
Reply with quote

when you are getting WERxxxx messages it means you are using SYNCSORT not DFSORT.
SQZ is available in SyncSort for z/OS Release 1.3. If you are using earlier versions of SYNCSORT you wont be able to use this feature.

Better go for a COBOL program!
Back to top
View user's profile Send private message
Moved: Tue May 13, 2008 12:57 pm by dick scherrer From DFSORT/ICETOOL to JCL
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 2:43 pm    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

I have solved this using cobol code.
But i m still not sure whether this can be done using SORT only not using DFSORT tools icon_smile.gif
Back to top
View user's profile Send private message
krisprems

Senior Member


Joined: 27 Nov 2006
Posts: 627
Location: India

PostPosted: Tue May 13, 2008 3:34 pm    Post subject: Re: Reply to: Removing starting spaces in lines
Reply with quote

scorp_rahul23 wrote:
I have solved this using cobol code.
But i m still not sure whether this can be done using SORT only not using DFSORT tools icon_smile.gif

To answer your question first of all i need to understand your knowledge about sort...

If you dont know, here is brief about DFSORT and SYNCSORT,
When you mention PGM=SORT or PGM=ICEMAN,
this invokes the underlying SORT product thats installed in your site, it may be DFSORT or SYNCSORT. In your case its SYNCSORT.

So, when you ask a question
Quote:
whether this can be done using SORT only not using DFSORT tools
, this doesnt make sense...
because SORT inturn is triggering the underlying DFSORT or SYNCSORT.

Hope you got the point that i am stressing on...!
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Tue May 13, 2008 4:42 pm    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

Saying that does not mean I am saying its not possible in SORT.

I am saying I m not sure whether it can be done in Basic SORT utility not going for DFSORT or ICEMAN or ICETOOL

Thats it.

And thanks for ur help for cobol suggestion icon_biggrin.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2562
Location: italy

PostPosted: Tue May 13, 2008 5:08 pm    Post subject: Reply to: Removing starting spaces in lines
Reply with quote

Quote:
I am saying I m not sure whether it can be done in Basic SORT


it would be better to review Your understanding of program' s features
there is no such a thing as basic sort

z_os does not provide any sort facilities/programs/functions
these will be provided only by add on priced products from different companies
for the sake of example the most referred to sort products on these forums are

dfsort by https://www-304.ibm.com/systems/support/storage/software/sort/mvs/

syncsort by http://www.syncsort.com/company/home.htm

when You pay for any of these products there are no different charge features
You get the full package, You like it or not, basic, advanced, tools ( call them any way You want )

under different names You get

the sort itself, DFSORT, ICEMAN, SORT, SYNCSORT
the sort tools, ICETOOL,SYNCTOOL

so no business reason ( apart sheer ignorance on the rule-setters side )
to forbid the usage of programs and facilities which are being paid for
Back to top
View user's profile Send private message
Pandiarajan Thavamani

New User


Joined: 19 May 2008
Posts: 1
Location: Chennai

PostPosted: Mon Jun 02, 2008 11:50 am    Post subject:
Reply with quote

It can be done using normal sort program.


//YB31CHEK JOB ,'COPY DRSCOPY TO DISK',CLASS=4,MSGCLASS=Y,
// NOTIFY=&SYSUID
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=XB48.TXHX0TRP.TEST,DISP=SHR
//SORTOUT DD DSN=XB48.TXHX0TRP.TEST1,DISP=OLD
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,8,ZD,EDIT=(TTTTTTTT))
/*
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7518
Location: 221 B Baker St

PostPosted: Mon Jun 02, 2008 2:08 pm    Post subject:
Reply with quote

Hello Pandiarajan Thavamani and welcome to the forums,

Please check your reply and make sure the topic replied to is the one you intended. Your suggestion does not appear to be for this topic.

This topic has to do with eliminating leading spaces in data records while yours edits some numeric field.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7518
Location: 221 B Baker St

PostPosted: Mon Jun 02, 2008 9:30 pm    Post subject:
Reply with quote

Hello,

Have you determined where your reply should be located (which topic it is a reply to)?

I'll relocate this when you say where it should go.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1