EDIT a STRING

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
mantorras2006
Member
Posts: 3
Joined: Thu Apr 19, 2007 7:27 pm

EDIT a STRING

Post by mantorras2006 » Fri Apr 20, 2007 1:46 am

I need to convert a string of a file that have a variable part (with comp's and alphanumerics) to a string with a format edit. But the layout of the string is variable in every line of a file.
The command edit dont work.

User avatar
DavidatK
Active Member
Posts: 65
Joined: Tue Mar 27, 2007 8:41 am
Location: Troy, MI USA

Post by DavidatK » Fri Apr 20, 2007 2:34 am

My friend,

You?re going to have to give us more information than that. Many of the members here are very good, but not mind readers :) . Can you please give us some examples of the input you?re dealing with and what needs to be done with it? Please be very specific in your examples and processing. The more specific you are the more specific we can be with a solution.

Thanks, and post back soon

Dave

mantorras2006
Member
Posts: 3
Joined: Thu Apr 19, 2007 7:27 pm

Post by mantorras2006 » Fri Apr 20, 2007 1:20 pm

Thank for your point Dave, but i dont need that you gave me the exact jcl code, but the instruction or instructions that made my wish possible (no need for mind readers)

The file (with hexa):

000000000000002
FFFFFFFFFFFFFFF4444444444444444444444444
0000000000000020000000000000000000000000
----------------------------------------
PT 00352007010901000000022
DE4FFFFFFFFFFFFFFFFFFFFFFF44444444444444
7300035200701090100000002200000000000000
----------------------------------------
PT 00352007010901000000022
DE4FFFFFFFFFFFFFFFFFFFFFFF44444444444444
7300035200701090100000002200000000000000
----------------------------------------
06PT * @ j< ?
FFDE005007000394007210003000044444444444
067303C20C00431C2002C000C000C00000000000

As you can see in each line have have a different layout. I want to convert this in a string with no comps but i dont not how because a dont know the multiple layouts of each line.

acevedo
Member
Posts: 12
Joined: Wed Mar 21, 2007 3:44 pm

Post by acevedo » Fri Apr 20, 2007 1:25 pm

and... depending on what you know the different layout each line has?
Google is your friend!

mantorras2006
Member
Posts: 3
Joined: Thu Apr 19, 2007 7:27 pm

Post by mantorras2006 » Fri Apr 20, 2007 4:14 pm

have comp's or alphanumerics, but among the field, and i dont know the multiple layouts.
A want to convert a field of line of a file, that i dont know the layout (and have comp's in some positions in a line of the file but in other position of other lines), to a format display (without comp's)

acevedo
Member
Posts: 12
Joined: Wed Mar 21, 2007 3:44 pm

Post by acevedo » Fri Apr 20, 2007 5:17 pm

Many of the members here are very good, but not mind readers...


nor any utility.

If I'm not wrong you'll need to specify the start and length of any field you want to convert.
Google is your friend!

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Fri Apr 20, 2007 10:22 pm

mantorras2006,

Where and how is this file being generated in your system.

If this particular file is being read as I/P for some programs or O/P for programs then there should be some way of identifying each record and then it processes it.

well If this file is not generated by the system then one has to think :)

And as acevedo mentioned one should definitely need the start and end position by which we can try some means ??? that info wud be useful.

I was just thinking

If we have COMP filed and we need to convert ...the usual way of doing it wud be to declare a equivalent numeric variable and then

redefine it into a alphanumeric.


If i am not wrong if you can come up with some details reg the start and end positions i blive there is a way in SORT by which we can convert the

data types. I am not sure , but yes if you come back with details i am sure we can get info from Frank on SORT and figure out a means to do.

Thanks,
Veera.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Apr 20, 2007 11:01 pm

Yes, DFSORT can convert BI values to formatted numeric values, but you have to know the starting position and length of each value to be converted. All data is binary - the interpretation of the data may be other than binary but there's no magic way for a program to know that unless there are specific rules such as "the binary field is from positions 5-8" or "each binary field starts with X'FFFF' and is 4 bytes long".
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others