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

how to check spaces at a particular position of a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Thu Nov 08, 2012 5:07 pm
Reply with quote

Hi All,

I want to check spaces on a particular position of a file and if found want to displace the record by some bytes.

Input file is having following record

Code:
50 NEWYORK MICHAEL JOHN US CITIZEN


I want to check the first space encountered from position 11th and then start the next variable from position 30th of my output file.

Output file will look like:

Code:
50 NEWYORK MICHAEL                                  JOHN US CITIZEN


File is a FB and LRECL as 1000.

Regards
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Nov 08, 2012 5:27 pm
Reply with quote

INREC IFTHEN check for space if it satisfies do the BUILD as per your requirement

Also forgot to ask what will be the lenghth of the output if your input has space in 11th column and has data in rest of the column till 1000
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 Nov 08, 2012 5:32 pm
Reply with quote

Your data doesn't match your description.

Please show sufficient examples and expected output to fully describe what you want.
Back to top
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Thu Nov 08, 2012 5:40 pm
Reply with quote

Hi,

Even though the file is of 1000 bytes the record is max of 480 byes so there are no chances of truncation.

My question is: I want to check the first space encountered starting from 11th byte. Suppose the first space is at 17th byte, In that case I have to keep the first 17th byte as it is and rest of the data should start from a fixed position 30th byte.
The other situtation could be: First space is encountered at 15th byte, In that case I have to keep the first 15th byte as it is and rest of the data should start from a fixed position 30th byte.

Please let me know am I clear now icon_smile.gif.
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 Nov 08, 2012 5:46 pm
Reply with quote

In your example, the first space after the 11th byte is the one before MICHAEL.
Back to top
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Thu Nov 08, 2012 5:50 pm
Reply with quote

oops its a typo...Actually in my example NEWYORK is combined.
Anyway i want it to be checked from 11th byte itself.
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 Nov 08, 2012 5:55 pm
Reply with quote

Well, I'm not so sure if you can just stick NEWYORK itself together if you feel like it, but I've edited your original post to reflect this.
Back to top
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Thu Nov 08, 2012 5:59 pm
Reply with quote

Do you think we could do this using sort or icetool.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Nov 08, 2012 6:10 pm
Reply with quote

Hello,
If you post some input sample records with output records and explain all the possibilities, then someone will be able to give you a apt solution.
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 Nov 08, 2012 6:29 pm
Reply with quote

Beyond the 11th byte, are the positions of the remaining fields in the record variable?

Is this another attempt at your previous topic, which you seemed to lose interest in?
Back to top
View user's profile Send private message
Nitin Bhargava

New User


Joined: 22 May 2012
Posts: 32
Location: india

PostPosted: Thu Nov 08, 2012 7:07 pm
Reply with quote

Hi Bill,

I did my previous one by dividing it in multiple steps. Since this one is a bit straight forward I am thinking not to increase the steps in my job.

Here are some more example for this one


Code:
10 OHIO   JAMES KART US CITIZEN
20 TOWN   GORGE JUST US CITIZEN


Output expected
Code:
10 OHIO   JAMES                                KART US CITIZEN
20 TOWN   GORGE                                JUST US CITIZEN


Regards
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 Nov 08, 2012 9:03 pm
Reply with quote

You didn't answer, so let me ask in a different way.

Is your file

Fixed-length of "stuff"
Fixed-length of "name-stuff" to be re-arranged
Fixed-length of "rest-of-stuff"

Or

Fixed-length of "stuff"
Variably-positioned "stuff" including "name-stuff" to be rearranged

?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Nov 09, 2012 2:19 am
Reply with quote

Quote:
I want to check spaces on a particular position of a file

Quote:
Even though the file is of 1000 bytes the record is max of 480 byes so there are no chances of truncation.

I am confused here: by file do you mean dataset or record?

If your 'file' is 1000 bytes and lrecl is a max of 480 bytes I presume the maximum number of records is 2 but what is the minimum record length? What if your 'file' is empty?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 3:48 am
Reply with quote

Hello,

While your question is probably quite clear to you, it is not to everyone else. You need to clarify the info you have posted because it is confusing some (me<g>) of us.

Act like the max length (your 1000) is only 60. Then act like your 480 is only 20. Then show a few examples using these sizes (the ones you already have may work or they may need modification.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top