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

SORT Format should be RECFM=VB,LRECL=350


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Jan 15, 2016 8:20 pm
Reply with quote

Hi ,

I have a input file in the below format.
-------------------------------------------------------------------------------------
Code:
SQL> SET ECHO OFF                                                     
SQL> SET HEADING OFF                                                 
SQL> SET TERMOUT OFF                                                 
SQL> SET FEEDBACK OFF                                                 
SQL> SET TRIMSPOOL ON                                                 
SQL> SET PAGESIZE 0                                                   
SQL> SET COLSEP ','                                                   
SQL> SELECT TZR,PROP_CODE,TO_CHAR(INV_DATE,'YYYY'),'3001',           
  2         TO_CHAR(INV_DATE,'YYYY-MM-DD'),'0',USER_NOTES             
  3    FROM OYT_XP_DAILY_SPREAD                                       
  4    WHERE INV_DATE  BETWEEN  TO_DATE('02/01/2018','MM/DD/YYYY')   
3,BADPT,2018,3001,2018-02-01,0                                       
                                                                     
                                                                     
3,MADPT,2018,3001,2018-02-02,0                                       
                                                                     
                                                                     
3,CADPT,2018,3001,2018-02-03,0   

------------------------------------------------------------------------
Below is the input file formate,RECFM=VB,LRECL=1028.

I want out to be written as below,
Code:
BADPT,2018,3001,2018-02-01,0                                     
MADPT,2018,3001,2018-02-02,0 
CADPT,2018,3001,2018-02-03,0 


the Format should be RECFM=VB,LRECL=350.

Now i tried the below sort card,

Code:
 SORT FIELDS=COPY                 
 INCLUDE COND=(5,2,CH,EQ,C'1,',OR,
               5,2,CH,EQ,C'2,',OR,
               5,2,CH,EQ,C'3,')   
 OUTREC FIELDS=(1:7,5),CONVERT


But it is not working.

Could you please advise.

Thanks,
Sen

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2016 8:36 pm
Reply with quote

It's not clear what you are expecting CONVERT to do. You have no data which starts with '1,' or '2,'. Is that a typo in your sample?

Get rid of the OUTREC, don't use FIELDS on OUTREC (or INREC or OUTFIL OUTREC).

This may be what you want.

Code:
  INREC BUILD=(1,4,7)
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Jan 15, 2016 8:51 pm
Reply with quote

The records in INPUT IS IN THE BELOW FORMATE(RCFM=VB,LRECL=1028)
Code:
SQL> SET ECHO OFF
SQL> SET HEADING OFF
SQL> SET TERMOUT OFF
SQL> SET FEEDBACK OFF
SQL> SET TRIMSPOOL ON
SQL> SET PAGESIZE 0
SQL> SET COLSEP ','
SQL> SELECT TZR,PROP_CODE,TO_CHAR(INV_DATE,'YYYY'),'3001',
2 TO_CHAR(INV_DATE,'YYYY-MM-DD'),'0',USER_NOTES
3 FROM OYT_XP_DAILY_SPREAD
4 WHERE INV_DATE BETWEEN TO_DATE('02/01/2018','MM/DD/YYYY')
3,BADPT,2018,3001,2018-02-01,0


3,MADPT,2018,3001,2018-02-02,0


3,CADPT,2018,3001,2018-02-03,0

After Sort i want ot extract only the below records from Input file and write it into outputfile.

BADPT,2018,3001,2018-02-01,0
MADPT,2018,3001,2018-02-02,0
CADPT,2018,3001,2018-02-03,0

The output file RECFM should be RECFM=FB,LRECL=350.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2016 9:42 pm
Reply with quote

You've been a member here for six years+. Please use the code-tags to preserve spacing.


Code:
  OUTFIL BUILD=(7,346),VTOF


Your INCLUDE was basically correct, except for the three conditions, which only need be one.
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:23 pm
Reply with quote

I am getting below error

Code:

 WER250A  INCLUDE/OMIT FIELD BEYOND RECORD       


when i use the below sort card
Code:

SORT FIELDS=COPY               
INCLUDE COND=(5,2,CH,EQ,C'3,')
OUTREC BUILD=(7,346),VTOF
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:29 pm
Reply with quote

i tried

Code:

SORT FIELDS=COPY             
INCLUDE COND=(5,2,CH,EQ,C'3,')
OUTFIL BUILD=(7,346),VTOF     


still getting the error:
Code:

WER250A  INCLUDE/OMIT FIELD BEYOND RECORD
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2016 10:49 pm
Reply with quote

Code:
  SORT FIELDS=COPY             
  INCLUDE COND=(5,2,CH,EQ,C'3,')
  OUTFIL IFTHEN=(WHEN=INIT,
                  OVERLAY=(351:X)),
         IFTHEN=(WHEN=INIT,
  BUILD=(7,342)),VTOF,VLTRIM=C' '     
Back to top
View user's profile Send private message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Jan 15, 2016 10:58 pm
Reply with quote

I am able to get the result by using PARM='VLTESTI=1'
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 15, 2016 11:43 pm
Reply with quote

Next time explain what you mean by "not working", including any error messages in full.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
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 VB to FB - Finding LRECL SYNCSORT 4
Search our Forums:

Back to Top