IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Formatting data in input file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Mon Jan 05, 2009 11:56 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 05, 2009 12:22 pm
Reply with quote

Surya,

SyncSort questions are discussed in JCL forum and not in DFSORT forum.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 05, 2009 12:43 pm
Reply with quote

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
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Mon Jan 05, 2009 12:48 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 05, 2009 1:11 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 05, 2009 2:38 pm
Reply with quote

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
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Mon Jan 05, 2009 4:31 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 05, 2009 9:01 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 05, 2009 11:39 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jan 06, 2009 12:30 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Jan 06, 2009 4:25 am
Reply with quote

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
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Fri Jan 09, 2009 9:57 am
Reply with quote

Gerry,

Thanks for the solution. Its worked for me.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 09, 2009 10:04 am
Reply with quote

Hi,

I'm glad it helped.


Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
Search our Forums:

Back to Top