sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2119 Location: USA
|
|
|
|
Just for fun: one of multiple ways to do this
Code: |
//*=====================================================================
//UIDFINAL EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
TRANSACTION 00
TRANSACTION 01
TRANSACTION 02
TRANSACTION 03
TRANSACTION 04
TRANSACTION 05
TRANSACTION 06
TRANSACTION 07
TRANSACTION 08
TRANSACTION 10
//*
//SORTOUTF DD DISP=(NEW,CATLG),SPACE=(TRK,(5,5)),
// DSN=&SYSUID..GUID.TEXT
//SORTOUT DD SYSOUT=*
//*
//SYMNAMES DD *
GUID,30,36,CH
SourceRec,1,80
SeqNum,*,4,BI
*
DateTime5,*,26,CH
* 2024-05-09-11.07.29.820675
* |<---L9---->||<--R9--->|
Date5,=,10,CH
SKIP,1
Time5,*,8,CH
SKIP,1
Time5Ms,*,6,ZD
POSITION,DateTime5
SKIP,2
NumsLeft9,*,13,UFF
NumsRight9,*,11,UFF
*
Code1,*,4,BI
Code2,*,4,BI
Code3,*,4,BI
Code4,*,4,BI
*
POSITION,Code1
BinGUID1,*,4,BI
BinGUID2,*,2,BI
BinGUID3,*,2,BI
BinGUID4,*,2,BI
BinGUID5,*,6,BI
//*
//SYSIN DD *
INREC OVERLAY=(SeqNum:SEQNUM,4,BI,START=01010101,
INCR=01030507,
DateTime5:&DATE5)
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=INIT,
OVERLAY=(Code1:NumsRight9,TO=BI,LENGTH=4,
Code2:NumsLeft9,TO=BI,LENGTH=4,
Code3:NumsRight9,TO=BI,LENGTH=4,
Code4:NumsLeft9,TO=BI,LENGTH=4)),
IFTHEN=(WHEN=INIT,
OVERLAY=(Code1:Code1,SUB,SeqNum,TO=BI,LENGTH=4,
Code2:Code2,SUB,SeqNum,TO=BI,LENGTH=4,
Code3:Code3,ADD,SeqNum,TO=BI,LENGTH=4,
Code4:Code4,ADD,SeqNum,TO=BI,LENGTH=4)),
IFTHEN=(WHEN=INIT,
OVERLAY=(GUID:BinGUID1,HEX,C'-',
BinGUID2,HEX,C'-',
BinGUID3,HEX,C'-',
BinGUID4,HEX,C'-',
BinGUID5,HEX))
OUTFIL FNAMES=(SORTOUT,SORTOUTF),
BUILD=(SourceRec)
END
//*
//*===================================================================== |
Code: |
********************************* TOP OF DATA ******************************************
TRANSACTION 00 1411DB97-0E46-7720-1430-AF010E654A8A
TRANSACTION 01 1402222C-0E36-BDB5-1440-686C0E7503F5
TRANSACTION 02 13F268C1-0E27-044A-1450-21D70E84BD60
TRANSACTION 03 13E2AF56-0E17-4ADF-145F-DB420E9476CB
TRANSACTION 04 13D2F5EB-0E07-9174-146F-94AD0EA43036
TRANSACTION 05 13C33C80-0DF7-D809-147F-4E180EB3E9A1
TRANSACTION 06 13B38315-0DE8-1E9E-148F-07830EC3A30C
TRANSACTION 07 13A3C9AA-0DD8-6533-149E-C0EE0ED35C77
TRANSACTION 08 1394103F-0DC8-ABC8-14AE-7A590EE315E2
TRANSACTION 10 138456D4-0DB8-F25D-14BE-33C40EF2CF4D
******************************** BOTTOM OF DATA **************************************** |
|
|