View previous topic :: View next topic
|
Author |
Message |
rnimmala
New User
Joined: 08 Nov 2019 Posts: 9 Location: INDIA
|
|
|
|
I Have report file and it contains unpacked value spanned in 2 records.
e.g decimal 1234 ( in file it is not F1F2F3F4) value is displayed as
FFFF
1234
So my requirement is convert this to unhex value. I can't use TRAN=UNHEX.
Please suggest me any way to read the unpacked value i.e created by PLI UNPACK function. |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10763 Location: italy
|
|
|
|
you mean that the FFFF are in one record, and the 1234 is in the record which comes next ???
( obviously column aligned ) |
|
Back to top |
|
 |
rnimmala
New User
Joined: 08 Nov 2019 Posts: 9 Location: INDIA
|
|
|
|
yes. Your understanding is correct. |
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 2632 Location: NYC,USA
|
|
|
|
What don't you fix the module that created incorrect report ? |
|
Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10763 Location: italy
|
|
|
|
Quote: |
What don't you fix the module that created incorrect report ? |
IMO the module that created the <report> created what it was supposed to
( some kind of vertical hex dump perhaps )
and nothing wrong with that ( it takes quite a bit of coding to do it by hand )
my wild guess is that it is the output of some utility - could be even a <sort> step
the best thing would be to review the whole approach |
|
Back to top |
|
 |
rnimmala
New User
Joined: 08 Nov 2019 Posts: 9 Location: INDIA
|
|
|
|
Hi,
Even I am seeing first time in my 20 years Mainframe career. It is comparison report and convince purpose report displayed fields in vertical hex format. |
|
Back to top |
|
 |
Joerg.Findeisen
Active User

Joined: 15 Aug 2015 Posts: 449 Location: Bamberg, Germany
|
|
|
|
For example:
Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
FFFF
1234
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:SEQNUM,1,ZD,START=2,81:81,1,ZD,MOD,+2,ZD,LENGTH=1)),
IFTHEN=(WHEN=GROUP,BEGIN=(81,1,ZD,EQ,+0),RECORDS=2,PUSH=(82:1,4)),
IFTHEN=(WHEN=NONE,
PARSE=(%001=(FIXLEN=1,REPEAT=4),
%101=(ABSPOS=82,FIXLEN=1,REPEAT=4)),
BUILD=(%101,%001,%102,%002,%103,%003,%104,%004,81:81,1))
OUTFIL FNAMES=(SORTOUT),
INCLUDE=(81,1,ZD,EQ,+1),
BUILD=(1,8,TRAN=UNHEX)
END
/* |
Output:
Code: |
****** *******************
000001 1234
****** ******************* |
|
|
Back to top |
|
 |
rnimmala
New User
Joined: 08 Nov 2019 Posts: 9 Location: INDIA
|
|
|
|
Thank you. |
|
Back to top |
|
 |
sergeyken Warnings : 2 Senior Member

Joined: 29 Apr 2008 Posts: 1009
|
|
|
|
Simple solution for simple task:
Code: |
SORT FIELDS=COPY,SKIPREC=1,STOPAFT=1 |
|
|
Back to top |
|
 |
Joerg.Findeisen
Active User

Joined: 15 Aug 2015 Posts: 449 Location: Bamberg, Germany
|
|
|
|
sergeyken wrote: |
Simple solution for simple task:
Code: |
SORT FIELDS=COPY,SKIPREC=1,STOPAFT=1 |
|
What if you have more lines to decode, or not just digits? It will simply return incomplete or false results for such cases.
Multiline Digits only:
Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
FFFFFFFFFF
1234567890
FFFFFFFFFF
0987654321
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,SKIPREC=1
OUTFIL SAMPLE=2
END
/* |
|
|
Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 2632 Location: NYC,USA
|
|
|
|
Or just include NUM |
|
Back to top |
|
 |
sergeyken Warnings : 2 Senior Member

Joined: 29 Apr 2008 Posts: 1009
|
|
|
|
Joerg.Findeisen wrote: |
sergeyken wrote: |
Simple solution for simple task:
Code: |
SORT FIELDS=COPY,SKIPREC=1,STOPAFT=1 |
|
What if you have more lines to decode, or not just digits? It will simply return incomplete or false results for such cases. |
There was no request for something else:
Quote: |
I Have report file and it contains unpacked value spanned in 2 records. |
|
|
Back to top |
|
 |
|