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
 

 

Removing Empty Space from PS File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Removing Empty Space from PS File
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Apr 28, 2011 1:34 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Apr 28, 2011 1:37 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Apr 28, 2011 2:01 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Apr 28, 2011 2:09 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Apr 28, 2011 3:43 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Apr 28, 2011 5:13 pm    Post subject:
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

Senior Member


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

PostPosted: Mon May 02, 2011 3:50 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 02, 2011 3:57 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
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

Senior Member


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

PostPosted: Mon May 02, 2011 5:21 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 02, 2011 6:17 pm    Post subject: Reply to: REGARDING ROMOVING EMPTY SPACE FROM PS FILE
Reply with quote

see here on how to use dfsort to
Squeeze out blanks or other characters
ftp://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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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