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
 

 

converting hexa decimal into binary format using sort

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

New User


Joined: 02 Apr 2007
Posts: 4
Location: chennai

PostPosted: Mon May 28, 2007 12:07 pm    Post subject: converting hexa decimal into binary format using sort
Reply with quote

Hi everyone

can any one of u help me !!!!!

I want to sort the data into an output file from input file which is having hexa decimal values in to noramal binary format.

awaiting for ur reply
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon May 28, 2007 12:34 pm    Post subject:
Reply with quote

Please give examples of what the input looks like (hexa decimal values) and what you want the output to look like (noramal binary format).
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon May 28, 2007 12:47 pm    Post subject:
Reply with quote

Nitin,

Use OUTREC FIELDS=(start_position,var_length,PD,TO=BI). Please note that I have not converted HEXA to BINARY before and not tested the above sort card.

For more info, refer examples given at the bottom of the following link -

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ICECA109/3.14?DT=20020722140254
Back to top
View user's profile Send private message
k.nitin

New User


Joined: 02 Apr 2007
Posts: 4
Location: chennai

PostPosted: Mon May 28, 2007 1:27 pm    Post subject:
Reply with quote

examples:

000001 AMX 2007-05-25 ? ? N
000002 NMX 2006-05-15MKL ? %NJ1A * r?
000003 NMX 2006-06-02MKL ? NJ1A * r?
000004 NMX 2006-06-27MBL ? NJ1A * r?
000005 NMX 2006-10-19MBL ? ? NJ1A * r?
000006 NMX 2006-05-15MKL ? %NJ1A * r?
000007 NMX 2006-06-02MKL ? NJ1A * r?
000008 NMX 2006-06-27MBL ? NJ1A * r?
000009 NMX 2006-10-19MBL ? ? NJ1A * r?
000010 NMX 2006-05-15MKL ? %NJ1A * r?
000011 NMX 2006-06-02MKL ? NJ1A * r?
000012 NMX 2006-06-27MBL ? NJ1A * r?
000013 NMX 2006-10-19MBL ? ? NJ1A * r?
000014 NMX <2006-05-15MKL ? %NJ1A * r?

copybook:
01 DCLTXGR0FIX.
10 FIX-RO-NO PIC S9(5)V USAGE COMP-3.
10 FIX-FLOOR-CD PIC S9(2)V USAGE COMP-3.
10 FIX-AISLE PIC X(2).
10 FIX-AISLE-SIDE PIC X(1).
10 FIX-MODULE-NO PIC S9(2)V USAGE COMP-3.
10 FIX-MOD-EFFV-DT PIC X(10).
10 FIX-MODULE-TYPE PIC X(3).
10 FIX-BASE-SHELF-WIDTH PIC S9(4)V USAGE COMP-3.
10 FIX-BASE-SHELF-DEPTH PIC S9(4)V USAGE COMP-3.
10 FIX-SPINE-HEIGHT PIC S9(4)V USAGE COMP-3.
10 FIX-SHELF-QTY PIC S9(2)V USAGE COMP-3.
10 FIX-PROM-IND PIC X(1).
10 FIX-MGRP-CD PIC X(3).
10 FIX-MOD-SEQ-NO PIC S9(4) USAGE COMP.
10 FIX-WORTHED-MOD-VAL PIC S9(1)V9(2) USAGE COMP-3.
10 FIX-WORTHED-WIDTH PIC S9(4)V USAGE COMP-3.


I have given u the copybook and the input data

i want the data FIX-BASE-SHELF-WIDTH PIC S9(4)V USAGE COMP-3.
10 FIX-BASE-SHELF-DEPTH PIC S9(4)V USAGE COMP-3.
10 FIX-SPINE-HEIGHT PIC S9(4)V USAGE COMP-3.
10 FIX-SHELF-QTY PIC S9(2)V USAGE COMP-3.
10 FIX-PROM-IND PIC X(1).
10 FIX-MGRP-CD PIC X(3).
10 FIX-MOD-SEQ-NO PIC S9(4) USAGE COMP.
10 FIX-WORTHED-MOD-VAL PIC S9(1)V9(2) USAGE COMP-3.
10 FIX-WORTHED-WIDTH PIC S9(4)V USAGE COMP-3.

to get converted from hexa decimal to packed

can any one help me out!!
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon May 28, 2007 4:47 pm    Post subject:
Reply with quote

William Thompson wrote:
Please give examples of what the input looks like (hexa decimal values) and what you want the output to look like (noramal binary format).
This time try the actual input and output.
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: Mon May 28, 2007 9:42 pm    Post subject:
Reply with quote

You need to understand the various formats you're using and what you want to convert to what before anyone can help you. There's no such thing as hexadecimal format. Hexadecimal is just a way of representing values. Packed decimal is a format. Binary is a format. Zoned decimal is a format. All of these can be represented in hexadecimal.

COBOL has its own set of formats that correspond to DFSORT formats. For example, COMP-3 corresponds to PD. COMP corresponds to BI or FI, etc.

See the following for more information on COBOL formats vs DFSORT formats:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603

See the following for information on using DFSORT to convert from one format to another:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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