View previous topic :: View next topic
|
Author |
Message |
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi,
I have an input file with LRECL=133,RECFM=FB. It contains the following records
//dd1 DD dsn=a123456.xx.xxxx,disp=shr
//dd2 DD dsn=a123456.yy.yyyyy,disp=shr
...
...
....
I need to list out the dataset names "a123456.xx.xxxx" and "a123456.yy.yyyy" into output file (with RECL=133,FB). We are not sure about the record count of the input. It may contain more than 2 rows. Question is "DD" may not start in the same position in all the records. That is the reason we cannot use OUTREC to format the input file.
I tried with PARSE but my shop have SYNCSORT 1.2.3.1R version. So I am not able to use PARSE.
Can anybody help me out on this. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Surya,
SyncSort questions are discussed in JCL forum and not in DFSORT forum. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please show what you want for output.
Is all of the input jcl statements or might the dataset name occur elsewhere in the data? |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
My output should be:
a123456.xx.xxxx
a123456.yy.yyyyy
My output should contain the string which starts after "DD DSN=" and ends before ",". |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In Syncsort 1.2, there is a substring compare that could help identify the records (i might use dsn= rather than dd as the needed valud is immediagely after the "=".
Maybe someone will have s suggestion on how to pull only the dataset name from the identified records. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Surya,
Given that you dont have PARSE, I think it would be better to go for a few lines of COBOL/REXX code. |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Arun,
As we are in support (Testing) team, we are not given access to write/compile cobol programs. We have to do the things thru JCL.
I dont know about REXX. That is the reason I was looking for SYNCSORT. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might consider tso/ispf 3.15 Search-ForE and search for DSN=.
This would return a list of all of the members that contain dsn= and would show the actual statements. This would also work if the input was a sequential file and not a pds. You could also search a single member in a pds. . . |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I dont know about REXX |
Surya,
I am not a REXX expert. If I find something I'll post it here, still you can execute it via JCL. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
SUPERC (3.14/3.15) may also be run in batch and the otuput written into a file instead of the sysout shown here. . .
Code: |
//SEARCH EXEC PGM=ISRSUPC,
// PARM=(SRCHCMP,
// '')
//NEWDD DD DSN=MY.OWN.JCLLIB,
// DISP=SHR
//OUTDD DD SYSOUT=(X)
//SYSIN DD *
SRCHFOR 'DSN='
/*
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is some REXX code (from a non REXX expert) that should do the trick
Code: |
//COPYREXX EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&&SYSPROC(PULLDSN),
// DISP=(,PASS,DELETE),
// UNIT=VIO,
// SPACE=(TRK,(1,1,1)),
// DCB=(RECFM=FB,LRECL=80)
//SYSUT1 DD *,DLM='$$'
/**** REXX ****/
TRACE O
EOFFLAG = 2 /* RETURN CODE TO INDICATE END-OF-FILE */
RETURN_CODE = 0 /* INITIALIZE RETURN CODE */
EXITCODE = 0 /* INITIALIZE EXITCODE */
IN_CNTR = 0 /* INITIALIZE # OF LINES READ */
OUT_CNTR = 0 /* INITIALIZE # OF LINES WRITTEN */
/*********************************************************************/
/* OPEN THE "DDNAME" FILE, BUT DO NOT READ ANY RECORDS YET. ALL */
/* RECORDS WILL BE READ AND PROCESSED WITHIN THE LOOP BODY. */
/*********************************************************************/
"EXECIO 0 DISKR "FILEIN" (OPEN" /* OPEN "DDNAME" */
/*********************************************************************/
/* NOW READ ALL LINES FROM "DDNAME" STARTING AT LINE 1. */
/*********************************************************************/
DO WHILE (RETURN_CODE ¬= EOFFLAG) /* LOOP WHILE NOT END-OF-FILE */
"EXECIO 1 DISKR FILEIN" /* READ 1 LINE TO THE DATA STACK */
RETURN_CODE = RC /* SAVE EXECIO RC */
IF RETURN_CODE = 0 THEN /* GET A LINE OK? */
DO /* YES */
IN_CNTR = IN_CNTR + 1 /* INCREMENT INPUT LINE CNTR */
/* PULL LINE JUST READ FROM STACK*/
PULL RECORD
PARSE VAR RECORD . "DD DSN=" DSN "," TAIL
QUEUE DSN
"EXECIO * DISKW FILEOUT"
OUT_CNTR = OUT_CNTR + 1
END
END
SAY 'RECS READ =' IN_CNTR
SAY 'RECS OUT =' OUT_CNTR
"EXECIO 0 DISKR FILEIN (FINIS" /* CLOSE THE INPUT FILE DDNAME */
"EXECIO 0 DISKW FILEOUT (FINIS" /* CLOSE THE OUTPUT FILE DDNAME */
$$
//*
//**********************************************************************
//*
//PULLDSN EXEC PGM=IKJEFT01,DYNAMNBR=30,
// PARM='PULLDSN' /* REXNAME
//SYSPROC DD DSN=&&SYSPROC,DISP=(SHR)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//FILEIN DD DSN=input-file,DISP=SHR
//FILEOUT DD DSN=output-file,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(25,5),RLSE),
// DCB=(RECFM=FB,LRECL=133)
//*
//**********************************************************************
|
Gerry |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Gerry,
Thanks for the solution. Its worked for me. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I'm glad it helped.
Gerry |
|
Back to top |
|
|
|