View previous topic :: View next topic
Author
Message
rnimmala New User Joined: 08 Nov 2019Posts: 10 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 2007Posts: 10888 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 2019Posts: 10 Location: INDIA
yes. Your understanding is correct.
Back to top
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3076 Location: NYC,USA
What don't you fix the module that created incorrect report ?
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10888 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 2019Posts: 10 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 Senior Member Joined: 15 Aug 2015Posts: 1335 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 2019Posts: 10 Location: INDIA
Thank you.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2141 Location: USA
Simple solution for simple task:
Code:
SORT FIELDS=COPY,SKIPREC=1,STOPAFT=1
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1335 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 2010Posts: 3076 Location: NYC,USA
Or just include NUM
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2141 Location: USA
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
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1335 Location: Bamberg, Germany
Just wanted to add this here for interested parties.
Code:
//TRANHEXU EXEC PGM=ICEMAN
//SORTIN DD *
4444444444444444444444444444C988984E89998
00000000000000000000000000003649570214735
44444444444444444444444444444444A88A
000000000000000000000000000000003813
4444444444444444444444A999A4A884A8A48A4A89A984884444444444444444
0000000000000000000000669220385061809302864340250000000000000000
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(161:SEQNUM,1,ZD,START=2,161:161,1,ZD,MOD,+2,ZD,LENGTH=1)),
IFTHEN=(WHEN=GROUP,
BEGIN=(161,1,ZD,EQ,+0),RECORDS=2,PUSH=(81:1,80)),
IFTHEN=(WHEN=(161,1,ZD,EQ,+1),
FINDREP=(INOUT=(C' ',C'4'),STARTPOS=81,ENDPOS=160),HIT=NEXT),
IFTHEN=(WHEN=(161,1,ZD,EQ,+1),
FINDREP=(INOUT=(C' ',C'0'),STARTPOS=1,ENDPOS=80),HIT=NEXT),
IFTHEN=(WHEN=ANY,
PARSE=(%001=(FIXLEN=1,REPEAT=80),
%101=(FIXLEN=1,REPEAT=80)),
BUILD=(%101,%001,%102,%002,%103,%003,%104,%004,
%105,%005,%106,%006,%107,%007,%108,%008,
%109,%009,%110,%010,%111,%011,%112,%012,
%113,%013,%114,%014,%115,%015,%116,%016,
%117,%017,%118,%018,%119,%019,%120,%020,
%121,%021,%122,%022,%123,%023,%124,%024,
%125,%025,%126,%026,%127,%027,%128,%028,
%129,%029,%130,%030,%131,%031,%132,%032,
%133,%033,%134,%034,%135,%035,%136,%036,
%137,%037,%138,%038,%139,%039,%140,%040,
%141,%041,%142,%042,%143,%043,%144,%044,
%145,%045,%146,%046,%147,%047,%148,%048,
%149,%049,%150,%050,%151,%051,%152,%052,
%153,%053,%154,%054,%155,%055,%156,%056,
%157,%057,%158,%058,%159,%059,%160,%060,
%161,%061,%162,%062,%163,%063,%164,%064,
%165,%065,%166,%066,%167,%067,%168,%068,
%169,%069,%170,%070,%171,%071,%172,%072,
%173,%073,%174,%074,%175,%075,%176,%076,
%177,%077,%178,%078,%179,%079,%180,%080,161:161,1))
OUTFIL FNAMES=(SORTOUT),
INCLUDE=(161,1,ZD,EQ,+1),
REMOVECC,
BUILD=(1,160,TRAN=UNHEX)
END
/*
Back to top
Please enable JavaScript!