MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert PS to excel

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Feb 22, 2011 4:57 am    Post subject: Convert PS to excel Reply with quote

Hi,

I have a file (LRECL=80, RECFM=FB) with few records and need to create excel document. I am using below sort job to add the X'05' after each field to achieve it but getting ZERO suppression on the numeric fields that have numbers starting with ZERO.

The position 35 in input file has numbers like this -
Quote:

00001
02345
00987


I am using below sort card-
Code:

//JS030   EXEC PGM=SORT                               
//SORTIN    DD DSN=INPUT.DATASET,   
//             DISP=(SHR,KEEP,KEEP)                   
//SORTOUT   DD DSN=OUTPUT.DATASET,                               
//             DISP=(SHR,KEEP,KEEP)                   
//SYSIN     DD *     
  OPTION COPY                                             
  OUTREC FIELDS=(1,11,X'05',12,12,X'05',35,5,X'05',45,10) 
//SORTWK01  DD UNIT=SYSDA,SPACE=(CYL,(50,50),RLSE)   
//SORTWK02  DD UNIT=SYSDA,SPACE=(CYL,(50,50),RLSE)   
//SYSOUT    DD SYSOUT=*                               


After the excel sheet is received by email, we are seeing output at 35th position like this -
Code:

1
2345
987


How to get output to retain leading zeroes and see as it is in excel-
Code:

00001
02345
00987


Please help.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Tue Feb 22, 2011 7:12 am    Post subject: Reply with quote

That is the way excel handles numbers!
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Feb 22, 2011 7:28 am    Post subject: Reply with quote

you could create an import macro, which would set the attribute of all cells to text.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Feb 22, 2011 11:14 am    Post subject: Reply with quote

mf_user,

Please search before posting. Check this post and the solution posted by me

http://www.mvsforums.com/helpboards/viewtopic.php?p=41425#41425
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Feb 22, 2011 10:41 pm    Post subject: Reply with quote

Kolusu, thanks for the information.

Got this tip from somebody to keep X'7D' after the numeric field. It allowed the zeroes to be retained after excel conversion. Is this ok too?

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Feb 22, 2011 10:43 pm    Post subject: Reply with quote

this is how I modify the code......

Code:

//SYSIN     DD *     
  OPTION COPY                                             
  OUTREC FIELDS=(1,11,X'05',12,12,X'05',35,5,X'7D',X'05',45,10) 

_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Feb 22, 2011 11:07 pm    Post subject: Reply with quote

mf_user wrote:
Kolusu, thanks for the information.

Got this tip from somebody to keep X'7D' after the numeric field. It allowed the zeroes to be retained after excel conversion. Is this ok too?

Thanks.


Do you even know what the hex value of X'7D' mean? It is nothing but Single Quote ' and you will see the single quote in your Excel data. If that is ok with you, use it.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Tue Mar 01, 2011 4:33 am    Post subject: Reply with quote

Of course, not ok though Smile
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group