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

File Format of a PS File


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 9:04 am
Reply with quote

Hi, How can I determine the Format of a Mainframe PS file? I mean whether it's ASCII, Binary or others? I Tried Info, but I see no help there. Any help would be much appreciated. Thanks.

Wilson...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 9:29 am
Reply with quote

Hello,

Where did this file originate? Is the file now on dasd or is it a tape? What is the external definition of the content of the dataset(s)?

Which "info" did you try and what was shown to you from the file?

Typically a file transfer from Windows or UNIX causes the file to be converted from ascii to ebcdic. There can be exceptons, but normally, the conversion is handled by the file transfer.
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 9:33 am
Reply with quote

dick scherrer wrote:
Hello,

Where did this file originate? Is the file now on dasd or is it a tape? What is the external definition of the content of the dataset(s)?

Which "info" did you try and what was shown to you from the file?

Typically a file transfer from Windows or UNIX causes the file to be converted from ascii to ebcdic. There can be exceptons, but normally, the conversion is handled by the file transfer.


This PS File is the latest Generation in a GDG, created today. It's on DASD. I tried 'I' in front of the filename. I get File Type, LRECL etc, but no information whatsoever on the Format of the file. I'm not going to transfer it out to any other system, & it's not transferred in from any other system. What can I do to check the format of an existing Mainframe File?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 9:42 am
Reply with quote

Hello,

Use copy/paste, and the "Code" tag to post what you use 3.4 and select I for this dataset. Please do not use a screenshot as they introduce a lot of clutter.

It may help it you also post part of the first record with HEX ON.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 26, 2009 9:44 am
Reply with quote

Vivek Wilson wrote:
What can I do to check the format of an existing Mainframe File?
"Format" word is kind of mis-leading here, if it's a output of some event on Mainframes (output of COBOL, SORT, PL/I etc) you must be having a layout . . .does not that help you?
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 10:03 am
Reply with quote

dick scherrer wrote:
Hello,

Use copy/paste, and the "Code" tag to post what you use 3.4 and select I for this dataset. Please do not use a screenshot as they introduce a lot of clutter.

It may help it you also post part of the first record with HEX ON.


Sorry, I didn't get what you meant. Can you explain?
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 10:05 am
Reply with quote

Anuj D. wrote:
Vivek Wilson wrote:
What can I do to check the format of an existing Mainframe File?
"Format" word is kind of mis-leading here, if it's a output of some event on Mainframes (output of COBOL, SORT, PL/I etc) you must be having a layout . . .does not that help you?


No, I don't have access to the job or the Layout. I have just the file. I need to know whether the file is ASCII, Binat=ry or some other format.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 10:09 am
Reply with quote

Hello,

You need to post the information shown on 3.4 I (copy/paste - do not use a screenshot.

You also need to post some of the first record or 2 with HEX ON.
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 10:27 am
Reply with quote

Code:
Management class . . : PRDGDG1         Allocated cylinders : 20       
Storage class  . . . : PRD1000         Allocated extents . : 1         
 Volume serial . . . : 1GSMBS                                         
 Device type . . . . : 3390                                           
Data class . . . . . : ADDDSORG       Current Utilization             
 Organization  . . . : PS              Used cylinders  . . : 1         
 Record format . . . : FB              Used extents  . . . : 1         
 Record length . . . : 250                                             
 Block size  . . . . : 27750                                           
 1st extent cylinders: 20                                             
 Secondary cylinders : 5                                               
 Data set name type  :                 SMS Compressible  :   NO       
                                                                       
 Creation date . . . : 2009/03/25      Referenced date . . : 2009/03/25
 Expiration date . . : ***None***                                     


This is the Info I see. How can I identify the format from here?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 10:30 am
Reply with quote

Hello,

Your file is a qsam file with 250-byte records. The blksize is 27750.

In addition to that info, you also need to:
Quote:
You also need to post some of the first record or 2 with HEX ON.
From the data, we can learn more about how the content is stored.
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 10:41 am
Reply with quote

dick scherrer wrote:
Hello,

Your file is a qsam file with 250-byte records. The blksize is 27750.

In addition to that info, you also need to:
Quote:
You also need to post some of the first record or 2 with HEX ON.
From the data, we can learn more about how the content is stored.


Sorry, I left out that bit deliberately. This file is currently in Production, & I can't post Production data here. Is there no other way then?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 26, 2009 10:47 am
Reply with quote

Hello,

Quote:
I can't post Production data here. Is there no other way then?
Change something in the data before posting it so that it is no longer a problem.

The very high odds are that the file is a normal ebcdic file. There are very few ascii files on a mainframe.

The file may contain zoned-decimal, packed-decimal, and binary numeric values in addition to alphanumeric data.

Do you have a cobol layout for this file you can post?
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Thu Mar 26, 2009 11:03 am
Reply with quote

dick scherrer wrote:
Hello,

Quote:
I can't post Production data here. Is there no other way then?
Change something in the data before posting it so that it is no longer a problem.

The very high odds are that the file is a normal ebcdic file. There are very few ascii files on a mainframe.

The file may contain zoned-decimal, packed-decimal, and binary numeric values in addition to alphanumeric data.

Do you have a cobol layout for this file you can post?


People have been fired from my Company for doing this. I appreciate your willingness to help, but I honestly can't post additiona; info. Can you just tell me how I can distinguish between an EBCDIC File & an ASCII file? I'll do some more work by myself & determine teh format.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Mar 26, 2009 12:40 pm
Reply with quote

ASCII and EBCDIC do not exists in themselves
the only thing that exists are bytes which are made of bits

the classification ASCII EBCDIC or anything else You want
is a convention based on the use and/or the external representation

take for example the hex value 6B

with the ASCII convention it represents the letter k( lower case )

with the EBCDIC convention it represents the symbol , ( a comma )

but it could also represent the binary number 107

the question, as posed, does not have really any sense

by looking at the raw data You can tell just NOTHING

since you say that it is a production dataset
somewhere in your organization there should be a &COPYBOOK which describes it' s structure
( I hope for You )
as an alternative
consult the applcation documentation or ask Your peers
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 26, 2009 5:14 pm
Reply with quote

Quote:
Hi, How can I determine the Format of a Mainframe PS file? I mean whether it's ASCII, Binary or others?
I love questions like this ... there's so many ways to answer...

1) The format can be considered ASCII, EBCDIC, binary, hexadecimal all at the same time.
2) You are confusing an encoding (ASCII, EBCDIC, etc) with format (binary). All files are binary (that is, they consist of a sequence of bits).
3) As enrico points out, there is absolutely no way to tell from internal inspection of a file whether it has ASCII data, EBCDIC data, both, or neither. Only the application that generated the file can provide this data.
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Fri Mar 27, 2009 10:02 am
Reply with quote

Code:
PICTURE X(04).
PICTURE X(08).
PICTURE 9(04).
PICTURE X(08).
PICTURE 9(06).
PICTURE X(06).
PICTURE X(02).
PICTURE X(10).


This is the definition of the fields contained in the Copybook for this file. I have left out the field names, but all the fields in the associated copybook are Alphanumeric & Decimal definitions. There are no Signed or Compressed variables.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 27, 2009 10:11 am
Reply with quote

Hello,

From the fields you've now posted and the dataset info posted previously, you have a simple qsam file with fixed-length records.

What is the question? Why is there a problem?

Read the file in your program and do whatever is needed with the fields.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 27, 2009 10:21 am
Reply with quote

And what's the origin of the question - what made you to think that way?
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Fri Mar 27, 2009 10:26 am
Reply with quote

Well, I was asked by my Client to determine whether the file stored in DASD was with an encoding of ASCII or otherwise. Truth be told, I didn't think encoding applied to a file on DASD because when you FTP it out to Windows, you can choose to have it as ASCII, Binary or Whatnot. Since I was given as explicit instruction to determine the format IN DASD, I thought there would be a way to specify that in MVS.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 27, 2009 10:34 am
Reply with quote

Hello,

If you view the file in tso/ispf and the data is visable/readable, you have verified that the file is a simple sequential file ready for use in program code or utilities.

If the info appears garbled, look at the info in hex and post the hex of any one field or 2 and we should be able to clarify.
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Fri Mar 27, 2009 10:46 am
Reply with quote

If it's that simple, then sure. I'll check into the file names & raise a query if I come across some unreadable characters.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 27, 2009 10:51 am
Reply with quote

Good luck - someone will be here if there are questions icon_smile.gif

d
Back to top
View user's profile Send private message
Vivek Wilson

New User


Joined: 27 Nov 2008
Posts: 26
Location: India

PostPosted: Fri Mar 27, 2009 11:10 am
Reply with quote

Thanks Man. icon_biggrin.gif
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top