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
 

 

Need help in string formatting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ssundaram

New User


Joined: 22 Jan 2007
Posts: 8
Location: USA

PostPosted: Fri Feb 22, 2008 9:38 pm    Post subject: Need help in string formatting
Reply with quote

Code:

  EX1  66521 TEST RD 
  EX1  999   TEST RD
  EX2  13409 E STAR CREEK RD
  EX3  PO BOX 985


The above sre three types of my input records.
For EX1 I Need to exclude number in front (66521,999) and write only the word after the space.

For Ex2: I need to write the word after the single character in ouput.

For Ex3: I need to write as inthe input

Can anyone guide me on this

Thanks
Satya
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Feb 22, 2008 9:48 pm    Post subject:
Reply with quote

This looks more like a programming solution.
I'd use a perform loop with reference modification and scan input until one of the three rules had been satisfied, then just move the remainder.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 22, 2008 10:16 pm    Post subject:
Reply with quote

Satya,

It isn't clear what you want to do.

Are all of these input records in the same file, or are the EX1, EX2 and EX3 records in different files?

The rules you give are quite vague. It would help if you showed the expected output records.

For EX1, does the word you want to extract always start in the same position as shown in your example records, or is it more complicated than that? Is the pattern of the records always a number followed by a word, or can it be some other pattern?

For EX2, what is the pattern? Is the single character always an E or can it be any character? Is the single character always the second "word"?

You really need to do a better job of explaining the rules, and the pattern of the records before anyone can help you. Also, show better examples of input and output.
Back to top
View user's profile Send private message
ssundaram

New User


Joined: 22 Jan 2007
Posts: 8
Location: USA

PostPosted: Fri Feb 22, 2008 11:26 pm    Post subject: Reply to: Need help in string formatting
Reply with quote

Frank,

All the examples are there in the same input file. Basically what I require is for EX1 ,I need the word that follows the number and space which is not fixed.
For Ex2: I need the word that follows the number, space, single caharacter,space and the postion and value are not fixed.

Sorry for not being explanative.

Thanks
Satya
Back to top
View user's profile Send private message
ssundaram

New User


Joined: 22 Jan 2007
Posts: 8
Location: USA

PostPosted: Fri Feb 22, 2008 11:31 pm    Post subject: Reply to: Need help in string formatting
Reply with quote

Frank,
Here are the input and corresponding output i require

Input:

Code:

1100 TEST
100 SATYA
10 W HARISH
PO TEST


OUTPUT:
Code:

TEST
SATYA
HARISH


Thanks
Satya
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 22, 2008 11:52 pm    Post subject:
Reply with quote

Sigh. The patterns still aren't clear. Do you want to handle the records differently depending on their relative record number, that is, handle records 1 and 2 as EX1, handle record 3 as EX2 and handle record 4 as EX3, or are there some other rules for the pattern that indicates how a record should be handled?

Think of this in programming terms. You need a set of IF/THEN conditions to identify how each record should be handled, e.g.

IF (pattern1) THEN ...
IF (pattern2) THEN ...
...

and you need to describe the patterns. Is the pattern for EX1 a number followed by a word, or two words, or something else? Is the pattern for EX2 a number followed by a single character followed by a word, or something else?

What about EX3 ... you said "For Ex3: I need to write as inthe input" but you don't show the last input record in the output. Why? And if you do want it in the output, what is the pattern for EX3 ... is it a non-numeric followed by a word or something else?

You can't just throw out some vague requirement and expect somebody to tell you how to do it. You have to give clear requirements to get the correct result. That's a basic skill of programming. If you can't give clear requirements, then nobody can help you.

I suspect you can use DFSORT's PARSE function to do the kind of thing you want to do. You can read about DFSORT's PARSE function here:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm


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