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
 

 

TO find a variable at different location and format it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Thu Mar 22, 2012 12:43 pm    Post subject: TO find a variable at different location and format it
Reply with quote

Hi,

I have a file where a varable copy which is at different loc in a file.I need to format it so that I can get it allinged.

Could someone help me on this?
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Mar 22, 2012 12:51 pm    Post subject:
Reply with quote

call your team mate and show him what you posted here. See if he understands anything at all.

Please explain in detail how input output records look and how you want to achieve it.

The forum members are not professor Xaviers..
except me of course
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Mar 22, 2012 12:52 pm    Post subject: Reply to: TO find a variable at different location and forma
Reply with quote

I think you have to re-read what you have written, and then make it a lot clearer.

If you want to it in Syncsort, say so. How many files? What format is the field? What do you mean by "copy"? etc
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Thu Mar 22, 2012 1:09 pm    Post subject:
Reply with quote

the word copy is just an example.

In a file

dsadsdasdasdacopysdddsaddasdasd
sdsadassdasdsdasdassddcopyddsad
ssadsadasdsadasdsadsdasdasdsasdascopy

how can I format it as
dsadcopy
sdsacopy
ssadcopy
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Mar 22, 2012 1:14 pm    Post subject: Reply to: TO find a variable at different location and forma
Reply with quote

Well, some progresss.

You have a particular "string" which appears somewhere in a record and you'd like to have it in a fixed location?

If this is it, can the "string" occur more than once in the record? In your example the records are suddenly much shorter on output, is that something to do with the requirement?
Again, anything else you feel might clarify it for us.
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Thu Mar 22, 2012 1:53 pm    Post subject:
Reply with quote

The string wont occur more than once in the same record.Output is shorter than input as per the requirement
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Mar 22, 2012 2:12 pm    Post subject: Reply to: TO find a variable at different location and forma
Reply with quote

I don't know if this will give you something of a start, because things are still very unclear...

Code:
//FNDSTRNG EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'STRING'),
            BUILD=(1,5,C'STRING'))
//*
//SORTIN   DD *
STRING
   STRING FROM STUFF
X1234 STRING
X1234 STRONG STUFF HERE


Output is:

Code:
STRINSTRING           
   STSTRING           
X1234STRING           
X1234 STRONG STUFF HERE
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: Thu Mar 22, 2012 11:57 pm    Post subject:
Reply with quote

jemonthomas,

In your example, 'copy' appears in every record. If that's really the case then you can just use:

Code:

    OPTION COPY
    BUILD=(1,4,C'copy')


If it's more complicated then that (e.g. copy does NOT appear in every record), then you need to show a much better example of input and expected output for all of the possible variations. Showing the most trivial case does NOT lead to good solutions here.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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