Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Formatting data in input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Formatting data in input file
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: 2284
Location: @my desk

PostPosted: Mon Jan 05, 2009 12:22 pm    Post subject:
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

Site Director


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

PostPosted: Mon Jan 05, 2009 12:43 pm    Post subject:
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    Post subject: Reply to: Syncsort - Formatting data in input file
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

Site Director


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

PostPosted: Mon Jan 05, 2009 1:11 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Mon Jan 05, 2009 2:38 pm    Post subject:
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    Post subject: Reply to: Syncsort - Formatting data in input file
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

Site Director


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

PostPosted: Mon Jan 05, 2009 9:01 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Mon Jan 05, 2009 11:39 pm    Post subject:
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

Site Director


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

PostPosted: Tue Jan 06, 2009 12:30 am    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Jan 06, 2009 4:25 am    Post subject:
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    Post subject: Reply to: Syncsort - Formatting data in input file
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: 1703
Location: Australia

PostPosted: Fri Jan 09, 2009 10:04 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us