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
 

 

how to check spaces at a particular position of a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: how to check spaces at a particular position of a file
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

Moderator


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

PostPosted: Thu Nov 08, 2012 5:27 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Nov 08, 2012 5:32 pm    Post subject: Reply to: how to check spaces at a particular position of a
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Nov 08, 2012 5:46 pm    Post subject: Reply to: how to check spaces at a particular position of a
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Nov 08, 2012 5:55 pm    Post subject: Reply to: how to check spaces at a particular position of a
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    Post subject:
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: 1445
Location: Azeroth

PostPosted: Thu Nov 08, 2012 6:10 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Nov 08, 2012 6:29 pm    Post subject: Reply to: how to check spaces at a particular position of a
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Thu Nov 08, 2012 9:03 pm    Post subject: Reply to: how to check spaces at a particular position of a
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: 1717
Location: UK

PostPosted: Fri Nov 09, 2012 2:19 am    Post subject:
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

Site Director


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

PostPosted: Fri Nov 09, 2012 3:48 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 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