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
 

 

Formating the file using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Fri May 16, 2008 2:32 pm    Post subject: Formating the file using DFSORT
Reply with quote

Hi All,

i have one more problem.

i have input file like...

(record max length is 450, fileds are seperated by '|' symbol,
First field Max length is 8
then '|'
second field Max length is 7
then '|'
third field Max length is 7
then '|'.... like...
RECFM=VB)
Code:

1-----------------------------------300---------------------450
AAAAAAA|761|9999|200805|.............
AAAAAAA|463|99990|200805|............
AAAAAAA|1104|1|200805|...............
BBBBBBB|1104|10|200805|..............
AAAAAAA|1104|100|200805|.............
AAAAAAA|110|1000|200805|.............
AAAAAAA|1|1001|200805|...............


i want output file like below (here 'S' is spaces,RECFM=VB,and length of rec is same as input file)

i want First field length 8
after no '|'
second field length 7
after no '|'
third field length is 7
then '|'.... like...


Code:

AAAAAAAS761SSSS9999SSS|200805|......
AAAAAAAS463SSSS99990SS|200805|......
AAAAAAAS1104SSS1SSSSSS|200805|.......
BBBBBBBS1104SSS10SSSSS|200805|........
AAAAAAAS1104SSS100SSSS|200805|......
AAAAAAAS110SSSS1000SSS|200805|.....
AAAAAAAS1SSSSSS1001SSS|200805|...


Please let me know the way of the writing jcl to get required output file. please help me.

Thanks and Regards,
Nath R
Back to top
View user's profile Send private message

rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Fri May 16, 2008 2:58 pm    Post subject:
Reply with quote

Hi All,

little change in my requirement... sorry for inconvi.

i want the output file like below


Code:

AAAAAAAS00007610009999|200805|......
AAAAAAAS00004630099990|200805|......
AAAAAAAS00011040000001|200805|.......
BBBBBBBS00011040000010|200805|........
AAAAAAAS00011040000100|200805|......
AAAAAAAS00001100001000|200805|.....
AAAAAAAS00000010001001|200805|...


(Here 'S' is the spaces for first field and remaining two fileds are leading with zeros)

Thanks and regards,
Nath R
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Fri May 16, 2008 8:32 pm    Post subject:
Reply with quote

Hi All,

i got the solution for this... below is the code...

Code:

//STEP     EXEC PGM=ICEMAN                                             
//*                                                                     
//SYSOUT       DD  SYSOUT=*                                             
//*                                                                     
//SORTIN       DD  DSN=AA.BB.CC,                   
//            DISP=SHR                                                 
//*                                                                     
//SORTOUT      DD  DSN=A.B.C,                     
//            DISP=(NEW,CATLG,DELETE),                             
//            UNIT=SYSDA,SPACE=(TRK,(100,200),RLSE),               
//            DCB=(RECFM=VB,LRECL=454,BLKSIZE=0)                   
//*                                                               
//SYSIN        DD  *                 
  OPTION COPY                                                     
  INREC PARSE=(%00=(ENDBEFR=C'|',FIXLEN=8),                       
               %01=(ENDBEFR=C'|',FIXLEN=7),                       
               %02=(ENDBEFR=C'|',FIXLEN=7)
               %03=(FIXLEN=428),                       
        BUILD=(1,4,5:%00,13:%01,UFF,EDIT=(TTTTTTT),   
              20:%02,UFF,EDIT=(TTTTTTT),27:%03)               
//*



In "BUILD=(1,4" posion is reserved for VB file because of we need to copy the fixed parsed fields after the 4-byte RDW rather than at the end of the records. so thats why i declared the LRECL as 454. but if you are look at the output file the record length is 450 only.

I hope this will work... for mine its working fine.

Thanks and regards,
Nath R.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri May 16, 2008 10:00 pm    Post subject:
Reply with quote

I'm glad you figured this out yourself.

Not sure why you thought you needed LRECL=454 for the output file instead of LRECL=450. Since the input file is RECFM=VB, it includes the RDW in the LRECL of 450 as would the output file.
Back to top
View user's profile Send private message
rguhanath

New User


Joined: 16 Oct 2006
Posts: 80
Location: chennai

PostPosted: Sat May 17, 2008 11:06 am    Post subject:
Reply with quote

Thanks Frank,

i didnt try with LRECL=450. what i thought is that we need to reserve 4 bytes for VB format. so thats why i put 454.

Thanks and Regards,
Nath R
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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