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

how to line up this format? really need your help.


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

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Mon Apr 07, 2008 11:46 am
Reply with quote

Hi,

I need to line up the some sysin.

The old format like this:
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)      SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)    SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF) SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.BPPART)               SCRATCH LIMIT(03))     


The new format need to line up the SRATCH LIMIIT words from the col 49. So we would get the new format like that:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)   SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN) SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF)  SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)       SCRATCH LIMIT(03))   
DEF GDG (NAME(P&CUST.BPPART)         SCRATCH LIMIT(03))   



Anybody who know how to deal with this situation, plz kindly tell me.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 07, 2008 7:16 pm
Reply with quote

Have you looked at the functionality of DFSort's very powerful
PARSE
This operand allows you to extract variable position/length fields into fixed parsed fields. Parsed fields (%nn) can be used where fixed position/length fields (p,m) can be used in the BUILD (or OUTREC) or OVERLAY operands as described later in this section.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Apr 07, 2008 8:45 pm
Reply with quote

kennedy_zhu,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/72)
//SORTOUT DD DSN=...  output file (FB/72)
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%01=(ENDAT=C')',FIXLEN=48),
     %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),
     %03=(STARTAT=NONBLANK,FIXLEN=16)),
   BUILD=(%01,%02,%03)
/*
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Tue Apr 08, 2008 9:12 am
Reply with quote

Unfortunately, I got this error:
Code:
SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCS
                                       ELECTRONIC DATA SYSTEMS   z/OS   1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 31A2C, MODEL 2064 1C8              LICE
SYSIN :                                                                       
  OPTION COPY                                                                 
  INREC  PARSE=(%01=(ENDAT=C')',FIXLEN=48),                                   
             *                                                                   
                %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),                 
                %03=(STARTAT=NONBLANK,FIXLEN=16)),                           
         BUILD=(%01,%02,%03)                                                 
WER268A  INREC STATEMENT   : SYNTAX ERROR                                     

I replace the key word 'INREC' with 'OUTFIL', the same result we got.

Code:
SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCS
                                       ELECTRONIC DATA SYSTEMS   z/OS   1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 31A2C, MODEL 2064 1C8              LICE
SYSIN :                                                                       
  OPTION COPY                                                                 
  OUTFIL PARSE=(%01=(ENDAT=C')',FIXLEN=48),                                   
             *                                                                   
                %02=(STARTAT=NONBLANK,ENDBEFR=C' ',FIXLEN=8),                 
                %03=(STARTAT=NONBLANK,FIXLEN=16)),                           
         BUILD=(%01,%02,%03)                                                 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Apr 08, 2008 10:31 am
Reply with quote

kennedy_zhu,
You are using SYNCSORT.Not the DFSORT.SYNCSORT new version is having the support of PARSE(1.3 ).Youe env is having the older version(1.2.2.1R ) which is not supporting the PARSE function.

Thanks
Krishy
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Tue Apr 08, 2008 10:37 am
Reply with quote

all right. Maybe we can use another utility to solve the trouble. I would try to write a program. Anyway, thx. : )
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Apr 08, 2008 8:29 pm
Reply with quote

kennedy_zhu,
If you are okay with writing the Exit routines for the sort,here is the job which will solve your problem with the earlier releases of SYNCSORT.



Code:

//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SYSLIN   DD DSN=&S1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)       
//SYSLMOD  DD DSN=&S2,DISP=(,PASS),SPACE=(CYL,(1,1,2),RLSE)     
//SORTIN   DD *                                                 
DEF GDG (NAME(P&CUST.ZK7AT.BPPART)      SCRATCH LIMIT(03))     
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)    SCRATCH LIMIT(03))     
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF) SCRATCH LIMIT(03))         
DEF GDG (NAME(P&CUST.BDCSTCDE)SCRATCH LIMIT(03))               
DEF GDG (NAME(P&CUST.BPPART)               SCRATCH LIMIT(03))   
//SORTOUT  DD DSN=XXXXXXX.YY.ZZ,                               
//            DISP=(NEW,CATLG,DELETE),                         
//            UNIT=SYSDK,SPACE=(TRK,(1,1),RLSE)                 
//SYSTSPRT DD SYSOUT=*                                         
//MODLIB   DD YOUR MODLLIB DATA SET,                           
//            DISP=SHR                                         
//SYSIN DD *                                                   
  SORT FIELDS=COPY                                             
  MODS E15=(E15Z,133,MODLIB,X)                                 


You need to place the below code in the MODLIB PDS with the name E15Z.

Code:


/* REXX E15Z */                       
ADDRESS 'SYNCREXX' 'GIVE'             
LS = LENGTH(SYRECORD)                 
IF LS > 0                             
THEN DO                               
SYACTION = 'REPLACE'                 
LSB = POS(')',SYRECORD)               
LSS = POS('SCRATC',SYRECORD)         
LSN1 = SUBSTR(SYRECORD,1,LSB)         
LSN2 = SUBSTR(SYRECORD,LSS,80)       
SYRECORD = SUBSTR(LSN1,1,48,' ')||LSN2
END                                   
ELSE DO                               
SYACTION = 'CLOSE'                   
END                                   
ADDRESS 'SYNCREXX' 'TAKE'             
RETURN                               


The o/p will be like below in the SORTOUT dataset.


Code:


DEF GDG (NAME(P&CUST.ZK7AT.BPPART)              SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN)            SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.ZK7AT.OTBXREF)             SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.BDCSTCDE)                  SCRATCH LIMIT(03))
DEF GDG (NAME(P&CUST.BPPART)                    SCRATCH LIMIT(03))



Thanks
Krishy
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Apr 10, 2008 12:32 pm
Reply with quote

Fabulous.

That's great.

I add some simple logic so that it could execute the continue line.

->

LSN0 = SUBSTR(SYRECORD,1,4)
IF LSN0 = ' '
THEN DO
LSB = 0
END
IF LSB <> 0 & LSS <> 0
THEN DO
LSN1 = SUBSTR(SYRECORD,1,LSB)

Thanks a million! Krishy.

And thanks for all of you, cool guy. : P
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Apr 10, 2008 12:34 pm
Reply with quote

Forget paste the continue line

->

DEF GDG (NAME(P&CUST.ZK7AT.ORDPREAN) -
SCRATCH LIMIT(03))
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts InfoSphere OPTIM CSV ouput vs DSNTIUA... IBM Tools 3
Search our Forums:

Back to Top