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

Removing Empty Space from PS File


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harish5002

New User


Joined: 21 Jul 2010
Posts: 23
Location: chennai

PostPosted: Thu Apr 28, 2011 1:26 pm
Reply with quote

HI All,
Data is retrived from oracle to flat file by giving the condition where there is a num field it should give 20 bytes space.So in flat file we got as below.Where ever the num field is there we 20 bytes.the file size 600 bytes.But now my requirement is to remove the adiitional sapace and decrease the length of the file.EX:suppose if u check third column we are having 7 bytes of data but remaining 13 bytes as free space.Like this lot of columns are there i need to reduce the empty sapce where 20bytes of space is occupied and i need to write into output file.....
We need to decrease the length of also.in the following we are having 60bytes as lenth if we remove the space it should decrease 26 bytes.

Please help me ASAP....................


Code:
     600000005143011;         84297116842;             3783061;
     600000005143012;         84297116842;             3783061;
     600000005143013;         84297116859;             3783061;
     600000005143014;         84297116859;             3783061;
     600000005143015;         84297116859;             3783061;
     600000005143016;         84297116859;             3783061;
     600000005143017;         84297118105;             3783061;
     600000005143017;         84297118105;             3783061;
     600000005143018;         84297116859;             3783061;
     600000005143019;         84297116088;             3783061;
     600000005143020;         84297116088;             3783061;
     600000005143020;         84297116088;             3783061;
     600000005143021;         84297118105;             3783061;


Thanks in advance,

HARISH
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Apr 28, 2011 1:34 pm
Reply with quote

we do not do asap... we do when and if we feel like icon_evil.gif

remember,
helping people/replying is
on voluntary basis
on our own time
free of charge
interest of the topic
benevolence factor

claiming urgency will most likely lower dramatically Your benevolence factor!

the fastest way would be anyway to look at the oracle manuals for strip/trim function to be applied at select time !

Quote:
Data is retrived from oracle to flat file by giving the condition where there is a num field it should give 20 bytes space.

but if You want to get rid of the extra space why do You enforce a useless condition at select

it would be better, in order not to waste everybody' s time to review the whole requirement and post again when You know for sure what You want to do
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 28, 2011 1:37 pm
Reply with quote

Is the data created "dynamically", can the file change layout change from run-to-run?

If the file layout is fixed, just define two record layouts, one with fillers for the blanks and the other not. Move the fields. Done.

Or not fixed? You might like to let us know. Let us know what you know about the file, hopefully it is more than you have already done.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Apr 28, 2011 2:01 pm
Reply with quote

Follow on...
if You cannot modify the database interface/queries run a two step process
using sort to squeeze out the useless blanks

after You have told us what sort product and what release You are running
somebody might move the topic to place where it belongs

( searching the dfsort forum with the squeeze keyword will return quite a few hits )
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 28, 2011 2:09 pm
Reply with quote

Sorry, thought the thread was in the Cobol forum :-)
Back to top
View user's profile Send private message
harish5002

New User


Joined: 21 Jul 2010
Posts: 23
Location: chennai

PostPosted: Thu Apr 28, 2011 2:58 pm
Reply with quote

Sorry,enrico for mentioning ASAP.

Hi Bill Woodger,
We can change the length in single or two steps.....I heard that we can remove the spaces by using sort.if i know particular field length we can otherwise is there any option....Because my file length is 6000.In that file some fields are having 20 bytes some fields will have 18 bytes it varies.If i want to count which field is having 20 bytes manually in the sense it will be very difficult.In that every field is separated by comma as shown above.

Thanks and Regards,
Harish
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 28, 2011 3:43 pm
Reply with quote

Can you, as enrico suggested, change the extract so that the spaces are dropped off before they even get to the file?

Otherwise, due to the size of the file, maybe Cobol would be better? Check out STRING/UNSTRING. Are all the records the same format? If yes, still check as you go along. Do you want to loose the space totally? You'll need to know how long the final record is. No big problem. Do you have text fields in the file as well, which may include blanks or semi-colons (;)?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Apr 28, 2011 5:13 pm
Reply with quote

Dare I ask why the requirement to remove the spaces.

If it is to save DASD space, then you will spend more money on processing time than you will save on DASD storage costs.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Mon May 02, 2011 3:50 pm
Reply with quote

I read description of the problem many times but could not make much sense out of it.

Also, if anyhow you achieve what you might be wanting - then, what is next?

Quote:
We need to decrease the length of also.in the following we are having 60bytes as lenth if we remove the space it should decrease 26 bytes.
This makes some sense and if this is all what you want - is not using OUTREC parameter of the SORT products would just do what you want.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon May 02, 2011 3:57 pm
Reply with quote

but something that does not make any sense
Quote:
Data is retrived from oracle to flat file by giving the condition where there is a num field it should give 20 bytes space

and then the TS asks how to get rid of the unwanted spaces ...

so the bothering question is ...
are the spaces wanted or not? meditate people meditate icon_cool.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Mon May 02, 2011 5:21 pm
Reply with quote

I agree with you Enrico. However, if you work from a vendor site, at times it so happens that IT Service companies work as different blocks of the same application which do not talk to each other.

In one of my assignment at other shop, we were involved in creating back-end DB2 Stored procedures whereas the other vendor was working on Front-end part of that application. I remember how tough call it was to convince the other vendor, to send us an indicator telling if they "want to scroll up or down" the "resultnat rows, if they don't fit on single page". ..I hope OP is not dealing with such things...though having initial valus from Oracle DB smells like that.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon May 02, 2011 6:17 pm
Reply with quote

see here on how to use dfsort to
Squeeze out blanks or other characters
ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Email attachment from mainframe is empty PC Guides & IT News 9
Search our Forums:

Back to Top