|
View previous topic :: View next topic
|
| Author |
Message |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
My requirement is very simple - Generate SYSIN card for fileaid. Both i/p & o/p files are of type FB, LRECL 80. Input file has one to 10 lines. Each line will have 3 digit numbers separated by comma/space/both. These numbers should be written in the AND part of the COPY statement as shown in the example given below.
Our mainframe does not have DFSORT. SORT/ICETOOL/SYNCSORT is preferred in our project.
Input file:
190, 191, 241, 245, 246, 249, 252, 256, 257,
258, 282, 294, 355, 862, 982, 397
Output file:
//SYSIN DD *
$$DD01 COPY IF=(1200,EQ,C'T'),
AND=(17,EQ,C'190',C'191',C'241',C'245',
C'246',C'249',C'252',C'256',
C'257',C'258',C'282',C'294',
C'355',C'862',C'982',C'397')
I am able to do it using REXX for testing purpose. But REXX is not allowed in production our organisation. However SAS is allowed and I know it can be done easily in SAS. But I don't know how to this in SAS.
I need a JCL/SAS. Your help is highly appreciated. |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
Use the Code Tag Button when presenting Code/Data here. Also, what have you tried using SORT? When not having DFSORT, why do you post in the DFSORT section of the Forum?
You can use PARSE to find the numbers, and IFTHEN to check for empty variables. Remember that line breaks are OUTFIL specific. |
|
| Back to top |
|
 |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
I tried to generate "AND" part using ICETOOL.
Code :
//STP10 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
190, 191,
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,5),RLSE)
//T2 DD DSN=&&T2,DISP=(,PASS),SPACE=(TRK,(1,5),RLSE)
//T3 DD DSN=&&T3,DISP=(,PASS),SPACE=(TRK,(1,5),RLSE)
//T4 DD DSN=&&T4,DISP=(,PASS),SPACE=(TRK,(1,5),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
RESIZE FROM(T1) TO(T2) TOLEN(16)
COPY FROM(T2) TO(T3) USING(CTL2)
COPY FROM(T3) TO(T4) USING(CTL3)
COPY FROM(T4) TO(OUT)
//CTL1CNTL DD *
OUTREC FINDREP=(INOUT=(C' ',C''))
//CTL2CNTL DD *
OUTREC FINDREP=(INOUT=(C',',C'QSCQ'))
//CTL3CNTL DD *
OUTREC FINDREP=(INOUT=(C'Q',X'7D',C'S',C','))
/*
Input file/data:
190, 191,
Output file:
190',C'191',C'
<4 empty lines> |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| Code: |
//WHATEVER EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
190, 191, 241, 245, 246, 249, 252, 256, 257,
258, 282, 294, 355, 862, 982, 397
/*
//OUT DD DISP=(NEW,PASS),UNIT=SYSALLDA,SPACE=(CYL,(2,1))
//SORTOUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(5)
COPY FROM(OUT) USING(FRED)
/*
//FREDCNTL DD *
OPTION COPY
INCLUDE COND=(1,1,CH,NE,C' ')
INREC IFTHEN=(WHEN=INIT,BUILD=(1,5,SQZ=(SHIFT=LEFT,PREBLANK=C',')))
OUTFIL FNAMES=(SORTOUT),
HEADER1=(C'$$DD01 COPY IF=(1200,EQ,C''T''),',
C'AND=(17,EQ,'),
BUILD=(17:C'C''',1,3,C''',',80:X),
TRAILER1=(17:C'C''$$$'')')
/* |
|
|
| Back to top |
|
 |
justjpr
New User
Joined: 03 Nov 2022 Posts: 36 Location: INDIA
|
|
|
|
| Thanks much Joerg.Findeisen for your prompt response. It works perfectly. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|