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
 

 

Changing the size of a field

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

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Wed Feb 21, 2007 6:28 pm    Post subject: Changing the size of a field
Reply with quote

Hi all,
I have an input file FB of LRECL 80 with only 1 column.Each record in the input file is of different length..
Eg:
Code:

00456789
56890
003788906
3452678


1.I need the O/P file with a length of 21 characters with zeros padded in front of the field..
Eg:
Code:

000000000000000456789
000000000000000056890
000000000000003788906
000000000000003452678


2.Also I need to add ' ' and a comma at the end of the column
Eg:
Code:

'000000000000000456789',
'000000000000000056890',
'000000000000003788906',
'000000000000003452678',


Thanks
Aneeta
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: Wed Feb 21, 2007 10:19 pm    Post subject:
Reply with quote

Aneeta,

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

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
00456789
56890
003788906
3452678
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'''',1,21,UFF,M11,LENGTH=21,C''',',80:X)
/*
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Thu Feb 22, 2007 11:56 am    Post subject: Re: Changing the size of a field
Reply with quote

It worked..Thanks a lot Frank..
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Thu Feb 22, 2007 6:15 pm    Post subject: Re: Changing the size of a field
Reply with quote

Hi Frank,
I have 1 more additional requirement now..I need to add ( in the first record and ) in the last record along with ;(semicolon).

Eg:
('000000000000000456789',
'000000000000000056890',
'000000000000003788906',
'000000000000003452678');

Note:The last record will not contain ,(comma).

Pls help me..Pls let me know if I had to open a new POST for this and I would do.

Thanks
Aneeta
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: Thu Feb 22, 2007 10:17 pm    Post subject:
Reply with quote

Aneeta,

That's a bit trickier, but here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
00456789
56890
003788906
3452678
/*
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(81:SEQNUM,8,ZD)
* Add seqnums to input file.
  OUTFIL FNAMES=T1
* Create symbol for last record as:
* LASTRCD,+nnnnnnnn
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
    BUILD=(1,80),
    TRAILER1=('LASTRCD,+',81,8)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
* Reformat each record to:
* 'ddddddddddddddddddddd',
     IFTHEN=(WHEN=INIT,
      BUILD=(C'''',1,21,UFF,M11,LENGTH=21,C''',',81:81,8)),
* Use seqnum = +1 to identify first record and
* reformat it to:
* ('ddddddddddddddddddddd',
     IFTHEN=(WHEN=(81,8,ZD,EQ,+1),
      BUILD=(C'(',1,24)),
* Use seqnum = LASTRCD to identify last record and
* reformat it to:
* 'ddddddddddddddddddddd');
     IFTHEN=(WHEN=(81,8,ZD,EQ,LASTRCD),
      OVERLAY=(24:C');'))
/*
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Thu Apr 05, 2007 12:16 pm    Post subject: Re: Changing the size of a field
Reply with quote

Hi Frank,
Thanks for the help.The JCL is working perfectly fine.But I am facing an issue when the input is only one record.

Eg:('000000000003452678'...the closing paranthese and semicolon is missing..

Pls help me..

Thanks
Aneeta
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: Thu Apr 05, 2007 8:21 pm    Post subject:
Reply with quote

Aneeta,

Just change the control statements for the S2 step to:

Code:

  OPTION COPY
  INREC IFOUTLEN=80,
* Reformat each record to:
* 'ddddddddddddddddddddd',
     IFTHEN=(WHEN=INIT,
      BUILD=(C'''',1,21,UFF,M11,LENGTH=21,C''',',81:81,8)),
* Use seqnum = +1 and seqnum = LASTRCD to handle only
* one record and reformat it to:
* ('ddddddddddddddddddddd');
     IFTHEN=(WHEN=(81,8,ZD,EQ,+1,AND,81,8,ZD,EQ,LASTRCD),
      BUILD=(C'(',1,23,C');')),
* Use seqnum = +1 to identify first record and
* reformat it to:
* ('ddddddddddddddddddddd',
     IFTHEN=(WHEN=(81,8,ZD,EQ,+1),
      BUILD=(C'(',1,24)),
* Use seqnum = LASTRCD to identify last record and
* reformat it to:
* 'ddddddddddddddddddddd');
     IFTHEN=(WHEN=(81,8,ZD,EQ,LASTRCD),
      OVERLAY=(24:C');'))
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Wed Apr 11, 2007 8:56 pm    Post subject: Re: Changing the size of a field
Reply with quote

Thanks Frank
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 BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 1 Tue Jul 25, 2017 12:12 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm


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