View previous topic :: View next topic
|
Author |
Message |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
ReXX Code
Code: |
/* ReXX */
InpFile = 'K001.K220.S01.G0005V00' ; Call Get_GDG_Base
InpFile = 'K001.K220.S01(0)' ; Call Get_GDG_Base
InpFile = 'K001.K220.S01(+5)' ; Call Get_GDG_Base
InpFile = 'K001.K220.S01' ; Call Get_GDG_Base
Exit
Get_GDG_Base :
GdgBase1 = ''
Select
When Right(InpFile,3)='V00' Then Do
/* K001.K220.S01.G0005V00 */
FLNAmeLen = Length(InpFile)
FLNAmeLen = FLNAmeLen-9
GdgBase1 = Left(InpFile,FLNameLen)
End
When Pos('(',InpFile) > 0 Then Do
/* K001.K220.S01(0) */
GdgBase1 = Left(InpFile,Pos('(',InpFile)-1)
End
Otherwise GdgBase1 = InpFile
End /* Select loop ends */
Say Left(InpFile,40) '>>' Left(GdgBase1,40)
Return |
o/p of this Rexx
Code: |
K001.K220.S01.G0005V00 >> K001.K220.S01
K001.K220.S01(0) >> K001.K220.S01
K001.K220.S01(+5) >> K001.K220.S01
K001.K220.S01 >> K001.K220.S01
***
|
I have written this REXX to convert GDG generation name to GDG Base name. It works perfectly. I think this can easily be done by ICETOOL/DFSORT. Please help as I am not familiar with string operation using SORT.
Input and output files are FB/200. STARTPOS=1 & ENDPOS=44 for file name. There are other types of files in the input which doesn't require any change. GDG files can be identified by the 'GDG' string in the position 48 to 50.
i/p :
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
K002.K221.S01.G0005V00 ,G,GDG,VB, 500, 504,CYL,
K005.K223.S01(0) ,G,GDG,VB, 500, 504,CYL,
K001.K220.S01 ,G,GDG,VB, 500, 504,CYL,
U002.FL1A602.MASTER ,O,VSM,VB, 1546, 1550,CYL,
T003.INFO.MASTER.PAA ,P,VSM,FB, 200, 0,TRK,
E001.PRINT.ADVICE ,D,SEQ,VB, 23032, 23036,TRK,
J001.K320.S01(+5) ,G,GDG,VB, 500, 504,CYL,
E005.CH001.DOWNLOAD ,D,SEQ,FB, 650, 0,TRK,
|
o/p :
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
K002.K221.S01 ,G,GDG,VB, 500, 504,CYL,
K005.K223.S01 ,G,GDG,VB, 500, 504,CYL,
K001.K220.S01 ,G,GDG,VB, 500, 504,CYL,
U002.FL1A602.MASTER ,O,VSM,VB, 1546, 1550,CYL,
T003.INFO.MASTER.PAA ,P,VSM,FB, 200, 0,TRK,
E001.PRINT.ADVICE ,D,SEQ,VB, 23032, 23036,TRK,
J001.K320.S01 ,G,GDG,VB, 500, 504,CYL,
E005.CH001.DOWNLOAD ,D,SEQ,FB, 650, 0,TRK,
|
|
|
Back to top |
|
 |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
I tried and got a partial functionality.
Code: |
//S5 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//OUT DD SYSOUT=*
//*-+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
//IN DD *
K002.K221.S01.G0005V00 ,G,GDG,VB, 500, 504,CYL,
K005.K223.S01(0) ,G,GDG,VB, 500, 504,CYL,
K001.K220.S01 ,G,GDG,VB, 500, 504,CYL,
U002.FL1A602.MASTER ,O,VSM,VB, 1546, 1550,CYL,
T003.INFO.MASTER.PAA ,P,VSM,FB, 200, 0,TRK,
E001.PRINT.ADVICE ,D,SEQ,VB, 23032, 23036,TRK,
J001.K320.S01(+5) ,G,GDG,VB, 500, 504,CYL,
B005.CH001.DOWNLOAD ,D,SEQ,FB, 650, 0,TRK,
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(048,03,CH,EQ,C'GDG'),
PARSE=(%00=(ENDBEFR=C'V00',ENDBEFR=C'(',FIXLEN=44)),
BUILD=(%00,C';',46,35))
/*
|
o/p
Code: |
********************************* TOP OF DATA **********************************
K002.K221.S01.G0005 ;G,GDG,VB, 500, 504,CYL,
K005.K223.S01 ;G,GDG,VB, 500, 504,CYL,
K001.K220.S01 ;G,GDG,VB, 500, 504,CYL,
U002.FL1A602.MASTER ,O,VSM,VB, 1546, 1550,CYL,
T003.INFO.MASTER.PAA ,P,VSM,FB, 200, 0,TRK,
E001.PRINT.ADVICE ,D,SEQ,VB, 23032, 23036,TRK,
J001.K320.S01 ;G,GDG,VB, 500, 504,CYL,
B005.CH001.DOWNLOAD ,D,SEQ,FB, 650, 0,TRK,
******************************** BOTTOM OF DATA ********************************
|
GDG genation with '(' are properly converted.
K002.K221.S01.G0005V00 is converted to K002.K221.S01.G0005 as per my control card. It should be stipped (trimmed) to K002.K221.S01. Please help.
Note I built ';' at position 45 to identify (testing) editied gdg name. Aslo trucated o/p to 80 length for testing. Later it can be corrected. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1394 Location: Bamberg, Germany
|
|
|
|
Code: |
//WHATEVER EXEC PGM=ICEMAN
//SORTIN DD *
K002.K221.S01.G0005V00 ,G,GDG,VB, 500,
K005.K223.S01(0) ,G,GDG,VB, 500,
K001.K220.S01 ,G,GDG,VB, 500,
U002.FL1A602.MASTER ,O,VSM,VB, 1546,
T003.INFO.MASTER.PAA ,P,VSM,FB, 200,
E001.PRINT.ADVICE ,D,SEQ,VB, 23032,
J001.K320.S01(+5) ,G,GDG,VB, 500,
E005.CH001.DOWNLOAD ,D,SEQ,FB, 650,
/*
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(1,44,JFY=(SHIFT=RIGHT))),
IFTHEN=(WHEN=(37,1,CH,EQ,C'G',AND,38,4,FS,EQ,NUM,AND,
42,1,CH,EQ,C'V',AND,43,2,FS,EQ,NUM),
OVERLAY=(1,35,JFY=(SHIFT=LEFT,LENGTH=44))),
IFTHEN=(WHEN=NONE,
PARSE=(%01=(ENDBEFR=C'(',FIXLEN=44)),
OVERLAY=(%01,JFY=(SHIFT=LEFT)))
END
/* |
|
|
Back to top |
|
 |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
Thanks Joerg.Findeisen.
I like the full validation for GDG Gen&Ver
Code: |
'G'<4 digits>'V'<2 digits> |
|
|
Back to top |
|
 |
|
|